summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
authorFicus Kirkpatrick <ficus@android.com>2009-04-22 17:27:12 -0700
committerShawn O. Pearce <sop@google.com>2009-04-22 18:05:50 -0700
commit6f6cd77a50fd4ffff360d4aee1c6bc05bfb802c1 (patch)
tree981870a18b126f8d5a257eac80f8610a6175aaf0 /subcmds
parent896d5dffd313a2ad91fd8bee750241a6512b25dc (diff)
downloadgit-repo-6f6cd77a50fd4ffff360d4aee1c6bc05bfb802c1.tar.gz
Require a project or '--all' to be specified when using 'repo start'.
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/start.py16
1 files 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):
22 common = True 22 common = True
23 helpSummary = "Start a new branch for development" 23 helpSummary = "Start a new branch for development"
24 helpUsage = """ 24 helpUsage = """
25%prog <newbranchname> [<project>...] 25%prog <newbranchname> [--all | <project>...]
26""" 26"""
27 helpDescription = """ 27 helpDescription = """
28'%prog' begins a new branch of development, starting from the 28'%prog' begins a new branch of development, starting from the
29revision specified in the manifest. 29revision specified in the manifest.
30""" 30"""
31 31
32 def _Options(self, p):
33 p.add_option('--all',
34 dest='all', action='store_true',
35 help='begin branch in all projects')
36
32 def Execute(self, opt, args): 37 def Execute(self, opt, args):
33 if not args: 38 if not args:
34 self.Usage() 39 self.Usage()
@@ -39,7 +44,14 @@ revision specified in the manifest.
39 sys.exit(1) 44 sys.exit(1)
40 45
41 err = [] 46 err = []
42 all = self.GetProjects(args[1:]) 47 projects = []
48 if not opt.all:
49 projects = args[1:]
50 if len(projects) < 1:
51 print >>sys.stderr, "error: at least one project must be specified"
52 sys.exit(1)
53
54 all = self.GetProjects(projects)
43 55
44 pm = Progress('Starting %s' % nb, len(all)) 56 pm = Progress('Starting %s' % nb, len(all))
45 for project in all: 57 for project in all: