mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-19 12:34:17 +00:00
Add a project progress meter to 'repo sync'
This way users can see how much is left during fetch. Its especially useful when most syncs are no-ops but there are hundreds of repositories to poll. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@ -23,6 +23,7 @@ from git_command import GIT
|
||||
from command import Command, MirrorSafeCommand
|
||||
from error import RepoChangedException, GitError
|
||||
from project import R_HEADS
|
||||
from progress import Progress
|
||||
|
||||
class Sync(Command, MirrorSafeCommand):
|
||||
common = True
|
||||
@ -71,12 +72,16 @@ revision is temporarily needed.
|
||||
|
||||
def _Fetch(self, *projects):
|
||||
fetched = set()
|
||||
pm = Progress('Fetching projects', len(projects))
|
||||
for project in projects:
|
||||
pm.update()
|
||||
|
||||
if project.Sync_NetworkHalf():
|
||||
fetched.add(project.gitdir)
|
||||
else:
|
||||
print >>sys.stderr, 'error: Cannot fetch %s' % project.name
|
||||
sys.exit(1)
|
||||
pm.end()
|
||||
return fetched
|
||||
|
||||
def Execute(self, opt, args):
|
||||
@ -130,12 +135,14 @@ revision is temporarily needed.
|
||||
missing.append(project)
|
||||
self._Fetch(*missing)
|
||||
|
||||
pm = Progress('Syncing work tree', len(all))
|
||||
for project in all:
|
||||
pm.update()
|
||||
if project.worktree:
|
||||
if not project.Sync_LocalHalf(
|
||||
detach_head=opt.detach_head):
|
||||
sys.exit(1)
|
||||
|
||||
pm.end()
|
||||
|
||||
def _VerifyTag(project):
|
||||
gpg_dir = os.path.expanduser('~/.repoconfig/gnupg')
|
||||
|
Reference in New Issue
Block a user