sync: Display total elapsed fetch time

Give users an indication that `repo sync` isn't stuck if taking a long
time to fetch.

Bug: https://crbug.com/gerrit/11293
Change-Id: Iccdaec918f86c9cc2db5dc12f9e3eef7ad0bcbda
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/371414
Tested-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Joanna Wang <jojwang@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Gavin Mak
2023-04-27 05:58:57 +00:00
committed by LUCI
parent 7ef5b465cd
commit edcaa94ca8
2 changed files with 71 additions and 9 deletions

View File

@ -675,7 +675,13 @@ later is required to fix a server side protocol bug.
jobs = opt.jobs_network
fetched = set()
remote_fetched = set()
pm = Progress("Fetching", len(projects), delay=False, quiet=opt.quiet)
pm = Progress(
"Fetching",
len(projects),
delay=False,
quiet=opt.quiet,
show_elapsed=True,
)
objdir_project_map = dict()
for project in projects: