mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Add progress meter to 'repo start'
This is mostly useful if the number of projects to switch is many (e.g. all of Android) and a large number of them are behind the current manifest revision. We wind up needing to run git just to make the working tree match, and that often makes the command take a couple of seconds longer than we'd like. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
76ca9f8145
commit
0f0dfa3930
@ -782,7 +782,8 @@ class Project(object):
|
|||||||
cmd = ['checkout', name, '--']
|
cmd = ['checkout', name, '--']
|
||||||
return GitCommand(self,
|
return GitCommand(self,
|
||||||
cmd,
|
cmd,
|
||||||
capture_stdout = True).Wait() == 0
|
capture_stdout = True,
|
||||||
|
capture_stderr = True).Wait() == 0
|
||||||
|
|
||||||
branch = self.GetBranch(name)
|
branch = self.GetBranch(name)
|
||||||
branch.remote = self.GetRemote(self.remote.name)
|
branch.remote = self.GetRemote(self.remote.name)
|
||||||
@ -817,7 +818,8 @@ class Project(object):
|
|||||||
cmd = ['checkout', '-b', branch.name, rev]
|
cmd = ['checkout', '-b', branch.name, rev]
|
||||||
if GitCommand(self,
|
if GitCommand(self,
|
||||||
cmd,
|
cmd,
|
||||||
capture_stdout = True).Wait() == 0:
|
capture_stdout = True,
|
||||||
|
capture_stderr = True).Wait() == 0:
|
||||||
branch.Save()
|
branch.Save()
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
import sys
|
import sys
|
||||||
from command import Command
|
from command import Command
|
||||||
from git_command import git
|
from git_command import git
|
||||||
|
from progress import Progress
|
||||||
|
|
||||||
class Start(Command):
|
class Start(Command):
|
||||||
common = True
|
common = True
|
||||||
@ -38,9 +39,14 @@ revision specified in the manifest.
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
err = []
|
err = []
|
||||||
for project in self.GetProjects(args[1:]):
|
all = self.GetProjects(args[1:])
|
||||||
|
|
||||||
|
pm = Progress('Starting %s' % nb, len(all))
|
||||||
|
for project in all:
|
||||||
|
pm.update()
|
||||||
if not project.StartBranch(nb):
|
if not project.StartBranch(nb):
|
||||||
err.append(project)
|
err.append(project)
|
||||||
|
pm.end()
|
||||||
|
|
||||||
if err:
|
if err:
|
||||||
err.sort()
|
err.sort()
|
||||||
|
Loading…
Reference in New Issue
Block a user