From 6f6cd77a50fd4ffff360d4aee1c6bc05bfb802c1 Mon Sep 17 00:00:00 2001 From: Ficus Kirkpatrick Date: Wed, 22 Apr 2009 17:27:12 -0700 Subject: [PATCH] Require a project or '--all' to be specified when using 'repo start'. --- subcmds/start.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/subcmds/start.py b/subcmds/start.py index 8c74625f..ae2985d2 100644 --- a/subcmds/start.py +++ b/subcmds/start.py @@ -22,13 +22,18 @@ class Start(Command): common = True helpSummary = "Start a new branch for development" helpUsage = """ -%prog [...] +%prog [--all | ...] """ helpDescription = """ '%prog' begins a new branch of development, starting from the 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): if not args: self.Usage() @@ -39,7 +44,14 @@ revision specified in the manifest. sys.exit(1) 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)) for project in all: