From 151701e85f0beb1a7c896eb82c0d1f55ee380567 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Apr 2021 15:07:21 -0400 Subject: 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 Tested-by: Mike Frysinger --- subcmds/start.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subcmds/start.py') 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. if not os.path.exists(os.getcwd()): os.chdir(self.manifest.topdir) - pm = Progress('Syncing %s' % nb, len(all_projects)) + pm = Progress('Syncing %s' % nb, len(all_projects), quiet=opt.quiet) for project in all_projects: gitc_project = self.gitc_manifest.paths[project.relpath] # Sync projects that have not been opened. @@ -129,7 +129,7 @@ revision specified in the manifest. err.append(project) pm.update() - pm = Progress('Starting %s' % nb, len(all_projects)) + pm = Progress('Starting %s' % nb, len(all_projects), quiet=opt.quiet) # NB: Multiprocessing is heavy, so don't spin it up for one job. if len(all_projects) == 1 or opt.jobs == 1: _ProcessResults(self._ExecuteOne(opt, nb, x) for x in all_projects) -- cgit v1.2.3-54-g00ecf