summaryrefslogtreecommitdiffstats
path: root/subcmds/init.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/init.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/init.py')
-rw-r--r--subcmds/init.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index d86c49ae..a32eaae0 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -131,7 +131,9 @@ default.xml will be used.
131 131
132 m.Sync_LocalHalf() 132 m.Sync_LocalHalf()
133 if is_new or m.CurrentBranch is None: 133 if is_new or m.CurrentBranch is None:
134 m.StartBranch('default') 134 if not m.StartBranch('default'):
135 print >>sys.stderr, 'fatal: cannot create default in manifest'
136 sys.exit(1)
135 137
136 def _LinkManifest(self, name): 138 def _LinkManifest(self, name):
137 if not name: 139 if not name: