summaryrefslogtreecommitdiffstats
path: root/subcmds/checkout.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/checkout.py')
-rw-r--r--subcmds/checkout.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/subcmds/checkout.py b/subcmds/checkout.py
index 4198acd1..533d20e1 100644
--- a/subcmds/checkout.py
+++ b/subcmds/checkout.py
@@ -38,21 +38,27 @@ The command is equivalent to:
38 38
39 nb = args[0] 39 nb = args[0]
40 err = [] 40 err = []
41 success = []
41 all = self.GetProjects(args[1:]) 42 all = self.GetProjects(args[1:])
42 43
43 pm = Progress('Checkout %s' % nb, len(all)) 44 pm = Progress('Checkout %s' % nb, len(all))
44 for project in all: 45 for project in all:
45 pm.update() 46 pm.update()
46 if not project.CheckoutBranch(nb): 47
47 err.append(project) 48 status = project.CheckoutBranch(nb)
49 if status is not None:
50 if status:
51 success.append(project)
52 else:
53 err.append(project)
48 pm.end() 54 pm.end()
49 55
50 if err: 56 if err:
51 if len(err) == len(all): 57 for p in err:
52 print >>sys.stderr, 'error: no project has branch %s' % nb 58 print >>sys.stderr,\
53 else: 59 "error: %s/: cannot checkout %s" \
54 for p in err: 60 % (p.relpath, nb)
55 print >>sys.stderr,\ 61 sys.exit(1)
56 "error: %s/: cannot checkout %s" \ 62 elif not success:
57 % (p.relpath, nb) 63 print >>sys.stderr, 'error: no project has branch %s' % nb
58 sys.exit(1) 64 sys.exit(1)