Jump to content


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

p4 cli

  • Please log in to reply
3 replies to this topic

#1 eddieparker

eddieparker

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 July 2020 - 09:47 PM

When I do a p4 -I sync -q ... I see:

... 275 \

What is this number?  I thought at first it was a percentage which would be nice, now I"m not sure.  Is it the number of files it's syncing?

Whatever it is; some user feedback: I'd love if this was a bit more helpful to determine when a sync will be done.

( Ideally something like printf("%d/%d (%3.2f)", num_files_synced_so_far, num_files_to_sync_total, (num_files_synced_so_far/num_files_to_sync_total)*100.0f); )

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1148 posts

Posted 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).

#3 eddieparker

eddieparker

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 04 August 2020 - 07:05 PM

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.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1148 posts

Posted Yesterday, 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!  :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users