summaryrefslogtreecommitdiffstats
path: root/progress.py
Commit message (Collapse)AuthorAgeFilesLines
* Support units in progress messagesShawn O. Pearce2011-09-191-7/+8
| | | | | | | | This allows our progress meter to be used for bytes transferred, by setting the units to KB or MB to let the user know the size. Change-Id: Ie8653d4a40d79439026c18bd51915845b2c5bba9 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Do not emit progress if stderr is not a ttyShawn O. Pearce2010-05-271-2/+5
| | | | | | | | Avoids logging progress data into cron logs, etc. Suggested-by: Michael Richardson <mcr@sandelman.ottawa.on.ca> Change-Id: I4eefa2c282f0ca0a95a0185612b52e2146669e4c Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only display a progress meter once we spend 0.5 seconds on a taskShawn O. Pearce2009-04-181-1/+10
| | | | | | | | | | | | | | | The point of the progress meter is to let the user know that the task is progressing, and give them a chance to estimate when it will be complete. If the task completes in under 0.5 seconds then it is sufficiently fast enough that the user doesn't need to be kept up-to-date on its progress; in fact showing the meter may just slow the task down waiting on the tty to redraw. We now delay the progress meter 0.5 seconds (or 1 second if the Python time.time() function isn't accurate enough) to avoid any really fast tasks, like a no-op local sync. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Disable the progress meter when trace is enabledShawn O. Pearce2009-04-181-0/+7
| | | | | | | | | The trace output often interfers with the progress meter, so its easier to just disable the progress meter if trace is active. Its already verbose enough to let the user know we are working, which is all the progress meter is there for anyway. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't divide by zero in progress meterShawn O. Pearce2009-04-161-14/+27
| | | | | | | | | If there are no projects to fetch, the progress meter would have divided by zero during `repo sync`, and that throws a ZeroDivisionError. Instead we report the progress with an unknown amount remaining. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a project progress meter to 'repo sync'Shawn O. Pearce2009-04-101-0/+45
This way users can see how much is left during fetch. Its especially useful when most syncs are no-ops but there are hundreds of repositories to poll. Signed-off-by: Shawn O. Pearce <sop@google.com>