summaryrefslogtreecommitdiffstats
path: root/progress.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>