summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPär Åsfält <par.asfalt@gmail.com>2009-09-05 23:10:56 +0200
committerShawn O. Pearce <sop@google.com>2010-05-04 07:51:28 -0700
commitff6929dde8cae515f7221a60f21fff7c1297aade (patch)
tree9c5fad89e1260fe7a266479b4395efffafad2dd8
parent1c85f4e43ba2d337b1e8c49bb3c7814a5cb163ae (diff)
downloadgit-repo-ff6929dde8cae515f7221a60f21fff7c1297aade.tar.gz
branches: Enable output of multiple projects
Fixes a bug introduced by 498a0e8a79ab76eeb6adc40f12b04d59820716f9 ("Make 'repo branches -a' the default behavior"). Change-Id: Ib739f82f4647890c46d7c9fb2f2e63a16a0481de
-rw-r--r--subcmds/branches.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/subcmds/branches.py b/subcmds/branches.py
index 0e3ab3c2..a4f8d360 100644
--- a/subcmds/branches.py
+++ b/subcmds/branches.py
@@ -136,7 +136,7 @@ is shown, then the branch appears in all projects.
136 hdr('%c%c %-*s' % (current, published, width, name)) 136 hdr('%c%c %-*s' % (current, published, width, name))
137 out.write(' |') 137 out.write(' |')
138 138
139 if in_cnt < project_cnt and (in_cnt == 1): 139 if in_cnt < project_cnt:
140 fmt = out.write 140 fmt = out.write
141 paths = [] 141 paths = []
142 if in_cnt < project_cnt - in_cnt: 142 if in_cnt < project_cnt - in_cnt:
@@ -150,15 +150,17 @@ is shown, then the branch appears in all projects.
150 for b in i.projects: 150 for b in i.projects:
151 have.add(b.project) 151 have.add(b.project)
152 for p in projects: 152 for p in projects:
153 paths.append(p.relpath) 153 if not p in have:
154 paths.append(p.relpath)
154 155
155 s = ' %s %s' % (type, ', '.join(paths)) 156 s = ' %s %s' % (type, ', '.join(paths))
156 if width + 7 + len(s) < 80: 157 if width + 7 + len(s) < 80:
157 fmt(s) 158 fmt(s)
158 else: 159 else:
159 out.nl() 160 fmt(' %s:' % type)
160 fmt(' %s:' % type)
161 for p in paths: 161 for p in paths:
162 out.nl() 162 out.nl()
163 fmt(' %s' % p) 163 fmt(width*' ' + ' %s' % p)
164 else:
165 out.write(' in all projects')
164 out.nl() 166 out.nl()