From 0a389e94de32151189b7064d96eaaa0aa6cdb4a3 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 10 Apr 2009 16:21:18 -0700 Subject: 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 --- subcmds/init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'subcmds/init.py') 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. m.Sync_LocalHalf() if is_new or m.CurrentBranch is None: - m.StartBranch('default') + if not m.StartBranch('default'): + print >>sys.stderr, 'fatal: cannot create default in manifest' + sys.exit(1) def _LinkManifest(self, name): if not name: -- cgit v1.2.3-54-g00ecf