From ff6929dde8cae515f7221a60f21fff7c1297aade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20=C3=85sf=C3=A4lt?= Date: Sat, 5 Sep 2009 23:10:56 +0200 Subject: [PATCH] branches: Enable output of multiple projects Fixes a bug introduced by 498a0e8a79ab76eeb6adc40f12b04d59820716f9 ("Make 'repo branches -a' the default behavior"). Change-Id: Ib739f82f4647890c46d7c9fb2f2e63a16a0481de --- subcmds/branches.py | 12 +++++++----- 1 file 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. hdr('%c%c %-*s' % (current, published, width, name)) out.write(' |') - if in_cnt < project_cnt and (in_cnt == 1): + if in_cnt < project_cnt: fmt = out.write paths = [] if in_cnt < project_cnt - in_cnt: @@ -150,15 +150,17 @@ is shown, then the branch appears in all projects. for b in i.projects: have.add(b.project) for p in projects: - paths.append(p.relpath) + if not p in have: + paths.append(p.relpath) s = ' %s %s' % (type, ', '.join(paths)) if width + 7 + len(s) < 80: fmt(s) else: - out.nl() - fmt(' %s:' % type) + fmt(' %s:' % type) for p in paths: out.nl() - fmt(' %s' % p) + fmt(width*' ' + ' %s' % p) + else: + out.write(' in all projects') out.nl()