diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-22 00:04:39 -0500 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-22 08:23:51 +0000 |
commit | dcbfadf814aeb31bb66a265c74ef681d9dcb4875 (patch) | |
tree | 7cb94b6e75d8a497acde6ad03d3f115e00cca79c | |
parent | edd3d45b35c33e06f9d2f569d4fb1d9c9c739151 (diff) | |
download | git-repo-dcbfadf814aeb31bb66a265c74ef681d9dcb4875.tar.gz |
repo/init: improve basic progress messages
We produce some simple "Get" messages that aren't super clear as to
what they're doing, especially for people not familiar with repo.
Rephrase these to explicitly state the thing we're doing so it's
clear why we're downloading a particular source.
Bug: https://crbug.com/gerrit/11293
Change-Id: I0749504f17c5385c6c65274a274e0ae25b117413
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256455
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
-rwxr-xr-x | repo | 12 | ||||
-rw-r--r-- | subcmds/init.py | 3 |
2 files changed, 9 insertions, 6 deletions
@@ -531,6 +531,8 @@ def _Init(args, gitc_init=False): | |||
531 | else: | 531 | else: |
532 | do_verify = True | 532 | do_verify = True |
533 | 533 | ||
534 | if not opt.quiet: | ||
535 | print('Downloading Repo source from', url) | ||
534 | dst = os.path.abspath(os.path.join(repodir, S_repo)) | 536 | dst = os.path.abspath(os.path.join(repodir, S_repo)) |
535 | _Clone(url, dst, opt.clone_bundle, opt.quiet, opt.verbose) | 537 | _Clone(url, dst, opt.clone_bundle, opt.quiet, opt.verbose) |
536 | 538 | ||
@@ -752,9 +754,6 @@ def _InitHttp(): | |||
752 | 754 | ||
753 | 755 | ||
754 | def _Fetch(url, cwd, src, quiet, verbose): | 756 | def _Fetch(url, cwd, src, quiet, verbose): |
755 | if not quiet: | ||
756 | print('Get %s' % url, file=sys.stderr) | ||
757 | |||
758 | cmd = ['fetch'] | 757 | cmd = ['fetch'] |
759 | if quiet: | 758 | if quiet: |
760 | cmd.append('--quiet') | 759 | cmd.append('--quiet') |
@@ -801,8 +800,8 @@ def _DownloadBundle(url, cwd, quiet, verbose): | |||
801 | print('fatal: error %s' % e.reason, file=sys.stderr) | 800 | print('fatal: error %s' % e.reason, file=sys.stderr) |
802 | raise CloneFailure() | 801 | raise CloneFailure() |
803 | try: | 802 | try: |
804 | if not quiet: | 803 | if verbose: |
805 | print('Get %s' % url, file=sys.stderr) | 804 | print('Downloading clone bundle %s' % url, file=sys.stderr) |
806 | while True: | 805 | while True: |
807 | buf = r.read(8192) | 806 | buf = r.read(8192) |
808 | if not buf: | 807 | if not buf: |
@@ -825,6 +824,9 @@ def _ImportBundle(cwd): | |||
825 | def _Clone(url, cwd, clone_bundle, quiet, verbose): | 824 | def _Clone(url, cwd, clone_bundle, quiet, verbose): |
826 | """Clones a git repository to a new subdirectory of repodir | 825 | """Clones a git repository to a new subdirectory of repodir |
827 | """ | 826 | """ |
827 | if verbose: | ||
828 | print('Cloning git repository', url) | ||
829 | |||
828 | try: | 830 | try: |
829 | os.mkdir(cwd) | 831 | os.mkdir(cwd) |
830 | except OSError as e: | 832 | except OSError as e: |
diff --git a/subcmds/init.py b/subcmds/init.py index be73cecd..20030068 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -193,7 +193,8 @@ to update the working directory files. | |||
193 | sys.exit(1) | 193 | sys.exit(1) |
194 | 194 | ||
195 | if not opt.quiet: | 195 | if not opt.quiet: |
196 | print('Get %s' % GitConfig.ForUser().UrlInsteadOf(opt.manifest_url), | 196 | print('Downloading manifest from %s' % |
197 | (GitConfig.ForUser().UrlInsteadOf(opt.manifest_url),), | ||
197 | file=sys.stderr) | 198 | file=sys.stderr) |
198 | 199 | ||
199 | # The manifest project object doesn't keep track of the path on the | 200 | # The manifest project object doesn't keep track of the path on the |