mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Require a project or '--all' to be specified when using 'repo start'.
This commit is contained in:
parent
896d5dffd3
commit
6f6cd77a50
@ -22,13 +22,18 @@ class Start(Command):
|
|||||||
common = True
|
common = True
|
||||||
helpSummary = "Start a new branch for development"
|
helpSummary = "Start a new branch for development"
|
||||||
helpUsage = """
|
helpUsage = """
|
||||||
%prog <newbranchname> [<project>...]
|
%prog <newbranchname> [--all | <project>...]
|
||||||
"""
|
"""
|
||||||
helpDescription = """
|
helpDescription = """
|
||||||
'%prog' begins a new branch of development, starting from the
|
'%prog' begins a new branch of development, starting from the
|
||||||
revision specified in the manifest.
|
revision specified in the manifest.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def _Options(self, p):
|
||||||
|
p.add_option('--all',
|
||||||
|
dest='all', action='store_true',
|
||||||
|
help='begin branch in all projects')
|
||||||
|
|
||||||
def Execute(self, opt, args):
|
def Execute(self, opt, args):
|
||||||
if not args:
|
if not args:
|
||||||
self.Usage()
|
self.Usage()
|
||||||
@ -39,7 +44,14 @@ revision specified in the manifest.
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
err = []
|
err = []
|
||||||
all = self.GetProjects(args[1:])
|
projects = []
|
||||||
|
if not opt.all:
|
||||||
|
projects = args[1:]
|
||||||
|
if len(projects) < 1:
|
||||||
|
print >>sys.stderr, "error: at least one project must be specified"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
all = self.GetProjects(projects)
|
||||||
|
|
||||||
pm = Progress('Starting %s' % nb, len(all))
|
pm = Progress('Starting %s' % nb, len(all))
|
||||||
for project in all:
|
for project in all:
|
||||||
|
Loading…
Reference in New Issue
Block a user