Jump to content


[P4Python] which command supports P4.Progress?

progress outputhandler

  • Please log in to reply
2 replies to this topic

#1 nessus

nessus

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 01 May 2020 - 07:05 AM

Probably not python API specific but this is what I am using.

So with P4.Progress and P4.OutputHandler, I have got them working pretty well with
p4.run_sync('-q', path/..., progress=MyHandler, handler=MyHandler)
for progress feedback. But there are so many other p4 commands that could potentially take very long time, e.g. I am trying out
p4.run_diff('-sd', path/..., progress=MyHandler, handler=MyHandler)
, but I don't think it supports neither progress and outputhandler arguments.

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

#2 nessus

nessus

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 August 2020 - 08:28 PM

bump.
hoping to get some answers.

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1175 posts

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





Also tagged with one or more of these keywords: progress, outputhandler

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users