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/start.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/start.py')
-rw-r--r-- | subcmds/start.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subcmds/start.py b/subcmds/start.py index 2593ace6..aa2f915a 100644 --- a/subcmds/start.py +++ b/subcmds/start.py | |||
@@ -106,7 +106,7 @@ revision specified in the manifest. | |||
106 | if not os.path.exists(os.getcwd()): | 106 | if not os.path.exists(os.getcwd()): |
107 | os.chdir(self.manifest.topdir) | 107 | os.chdir(self.manifest.topdir) |
108 | 108 | ||
109 | pm = Progress('Syncing %s' % nb, len(all_projects)) | 109 | pm = Progress('Syncing %s' % nb, len(all_projects), quiet=opt.quiet) |
110 | for project in all_projects: | 110 | for project in all_projects: |
111 | gitc_project = self.gitc_manifest.paths[project.relpath] | 111 | gitc_project = self.gitc_manifest.paths[project.relpath] |
112 | # Sync projects that have not been opened. | 112 | # Sync projects that have not been opened. |
@@ -129,7 +129,7 @@ revision specified in the manifest. | |||
129 | err.append(project) | 129 | err.append(project) |
130 | pm.update() | 130 | pm.update() |
131 | 131 | ||
132 | pm = Progress('Starting %s' % nb, len(all_projects)) | 132 | pm = Progress('Starting %s' % nb, len(all_projects), quiet=opt.quiet) |
133 | # NB: Multiprocessing is heavy, so don't spin it up for one job. | 133 | # NB: Multiprocessing is heavy, so don't spin it up for one job. |
134 | if len(all_projects) == 1 or opt.jobs == 1: | 134 | if len(all_projects) == 1 or opt.jobs == 1: |
135 | _ProcessResults(self._ExecuteOne(opt, nb, x) for x in all_projects) | 135 | _ProcessResults(self._ExecuteOne(opt, nb, x) for x in all_projects) |