Jump to content


Sambwise

Member Since 12 Sep 2016
Offline Last Active Today, 06:58 AM
*****

Posts I've Made

In Topic: [P4Python] which command supports P4.Progress?

05 August 2020 - 06:44 AM

View Postnessus, on 01 May 2020 - 07:05 AM, said:

Are sync and submit the only two commands that support progress?

Yes and no.

Sync and submit are the only commands that support the Progress API as far as I know.

However, most p4 commands return their output one file at a time, even if they don't use the progress API, so if you're handling the output programmatically you can take advantage of that to build in the concept of progress tracking.

If you're willing to delve into the guts of the C++ client library implementation and make custom modifications to it, you could do some pretty fine-grained progress tracking for a command like "p4 diff -sd" (which might do a lot of work in between lines of output) by adding logic to the clientCheckFile function.  Run "p4 -vrpc=3 diff -sd" to get an idea of how this function works -- it's invoked for each file but it only prints output (via a server response) if the file is missing, so you could measure progress by the number of clientCheckFiles that have happened relative to the number of files in the client.

In Topic: What does the number in the p4 -I sync -q ... output mean?

05 August 2020 - 06:31 AM

View Posteddieparker, on 04 August 2020 - 07:05 PM, said:

Thanks for verifying.  Is this forum a good place to offer feedback suggestions?  I wish that information was already in the print-out versus having to do a p4 sync -n first, and that seems generally useful.

If you want feedback implemented in the official build I think you have to submit that through support@perforce.com.

For features in the command line client it's actually pretty easy to just roll them yourself as long as you're okay with doing your own builds.  The approach I'd suggest taking would be to implement your CLI sync progress bar as a client-side command (similar to "p4 set" or "p4 tickets") that invokes the appropriate server commands and formats the data the way you want it.  A good example of this sort of extension is "px" which is a custom version of p4 that adds extra options and commands: https://swarm.worksh...shawn_hladky/px  The "p4 undo" command was available in px as "p4 rollback" almost ten years before it was implemented in the server!  :)

In Topic: What does the number in the p4 -I sync -q ... output mean?

01 August 2020 - 06:10 PM

I wasn't sure, but a quick test confirms that it is indeed the number of files:

C:\Perforce\test>p4 sync #none | wc -l
3

C:\Perforce\test>p4 -I sync -q ...
... 3 finishing

It goes by too fast in my test case to actually see progress, but I assume with more data you see that number increase from 0 to whatever the full count is.  I think the idea is that if you want to gauge progress as a percentage, you'd preview the sync first with "-n" to get the total (that's what the UI does IIRC).

In Topic: Determining source of an integration when submitting from shelf

27 July 2020 - 02:51 PM

Try "p4 fstat -Or @=SHELF" -- I'm not positive whether it'll show the resolve info for the shelved revision, but that'd be the most likely place to find it.

If that doesn't work, you could temporarily unshelve the change, at which point it's an open file and the usual "p4 resolved" technique will work.

In Topic: Fetching/clone from remote

26 July 2020 - 02:44 PM

The first part of the error is pretty clear -- change 9 edited a file that the origin has deleted, so that edit conflicts with the delete.  In that instance the locally conflicting change is supposed to get kicked aside into a "tangent" depot to make space for the origin change.

Have you set up the permissions/configurables as described here in "p4 help fetch"?

		The -t flag specifies that conflicting changes should be moved to
		a new tangent, as described earlier. The -t flag requires the -r
		flag. The -t flag also requires that an administrator has set
		server.allowrewrite=1. In order to use the -t flag, you must have
		admin access to the files to be fetched.