summaryrefslogtreecommitdiffstats
path: root/subcmds/start.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-10 16:21:18 -0700
committerShawn O. Pearce <sop@google.com>2009-04-10 16:21:18 -0700
commit0a389e94de32151189b7064d96eaaa0aa6cdb4a3 (patch)
tree526a877b54a070746b7a0ae8b5657baa9e7aed0e /subcmds/start.py
parent2675c3f8b5865edff4fe6ec60187b32deef5041d (diff)
downloadgit-repo-0a389e94de32151189b7064d96eaaa0aa6cdb4a3.tar.gz
Make 'repo start' restartable upon failures
If `repo start foo` fails due to uncommitted and unmergeable changes in a single project, we have switched half of the projects over to the new target branches, but didn't on the one that failed to move. This change improves the situation by doing three things differently: - We keep going when we encounter an error, so other projects that can successfully switch still switch. - We ignore projects whose current branch is already on the requested name; they are logically already setup. - We checkout the branch if it already exists, rather than trying to recreate the branch. Bug: REPO-22 Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds/start.py')
-rw-r--r--subcmds/start.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/subcmds/start.py b/subcmds/start.py
index 4eb3e476..deced7c2 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -47,5 +47,13 @@ the configuration data is set up properly.
47 print >>sys.stderr, "error: '%s' is not a valid name" % nb 47 print >>sys.stderr, "error: '%s' is not a valid name" % nb
48 sys.exit(1) 48 sys.exit(1)
49 49
50 err = []
50 for project in self.GetProjects(args[1:]): 51 for project in self.GetProjects(args[1:]):
51 project.StartBranch(nb) 52 if not project.StartBranch(nb):
53 err.append(project)
54
55 if err:
56 err.sort()
57 for p in err:
58 print >>sys.stderr, "error: cannot start in %s" % p.relpath
59 sys.exit(1)