diff options
| author | Mike Frysinger <vapier@google.com> | 2021-04-13 15:07:21 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2021-04-13 22:25:26 +0000 |
| commit | 151701e85f0beb1a7c896eb82c0d1f55ee380567 (patch) | |
| tree | 7e86c0ff2835050abf73b62bac69390dfb67b8a6 /subcmds/sync.py | |
| parent | 9180a07b8fb33d5ba0b82facf987b51ca7b15dc4 (diff) | |
| download | git-repo-151701e85f0beb1a7c896eb82c0d1f55ee380567.tar.gz | |
progress: hide progress bar when --quiet
We want progress bars in the default output mode, but not when the
user specifies --quiet. Add a setting to the Progress bar class so
it takes care of not displaying anything itself rather than having
to update every subcommand to conditionally setup & call the object.
Change-Id: I1134993bffc5437bc22e26be11a512125f10597f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/303225
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index e7079879..21166af5 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -367,7 +367,7 @@ later is required to fix a server side protocol bug. | |||
| 367 | 367 | ||
| 368 | jobs = opt.jobs_network if opt.jobs_network else self.jobs | 368 | jobs = opt.jobs_network if opt.jobs_network else self.jobs |
| 369 | fetched = set() | 369 | fetched = set() |
| 370 | pm = Progress('Fetching', len(projects), delay=False) | 370 | pm = Progress('Fetching', len(projects), delay=False, quiet=opt.quiet) |
| 371 | 371 | ||
| 372 | objdir_project_map = dict() | 372 | objdir_project_map = dict() |
| 373 | for project in projects: | 373 | for project in projects: |
| @@ -470,7 +470,7 @@ later is required to fix a server side protocol bug. | |||
| 470 | # Only checkout projects with worktrees. | 470 | # Only checkout projects with worktrees. |
| 471 | all_projects = [x for x in all_projects if x.worktree] | 471 | all_projects = [x for x in all_projects if x.worktree] |
| 472 | 472 | ||
| 473 | pm = Progress('Checking out', len(all_projects)) | 473 | pm = Progress('Checking out', len(all_projects), quiet=opt.quiet) |
| 474 | 474 | ||
| 475 | def _ProcessResults(results): | 475 | def _ProcessResults(results): |
| 476 | for (success, project, start, finish) in results: | 476 | for (success, project, start, finish) in results: |
| @@ -504,7 +504,7 @@ later is required to fix a server side protocol bug. | |||
| 504 | return ret and not err_results | 504 | return ret and not err_results |
| 505 | 505 | ||
| 506 | def _GCProjects(self, projects, opt, err_event): | 506 | def _GCProjects(self, projects, opt, err_event): |
| 507 | pm = Progress('Garbage collecting', len(projects), delay=False) | 507 | pm = Progress('Garbage collecting', len(projects), delay=False, quiet=opt.quiet) |
| 508 | pm.update(inc=0, msg='prescan') | 508 | pm.update(inc=0, msg='prescan') |
| 509 | 509 | ||
| 510 | gc_gitdirs = {} | 510 | gc_gitdirs = {} |
