mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Make 'repo branches -a' the default behavior
Extensive discussion with users lead to the fact that needing to supply -a to view what they really wanted to see was just wrong. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
bc7ef67d9b
commit
498a0e8a79
@ -63,11 +63,6 @@ class Branches(Command):
|
|||||||
Summarizes the currently available topic branches.
|
Summarizes the currently available topic branches.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _Options(self, p):
|
|
||||||
p.add_option('-a', '--all',
|
|
||||||
dest='all', action='store_true',
|
|
||||||
help='show all branches, not just the majority')
|
|
||||||
|
|
||||||
def Execute(self, opt, args):
|
def Execute(self, opt, args):
|
||||||
projects = self.GetProjects(args)
|
projects = self.GetProjects(args)
|
||||||
out = BranchColoring(self.manifest.manifestProject.config)
|
out = BranchColoring(self.manifest.manifestProject.config)
|
||||||
@ -84,18 +79,6 @@ Summarizes the currently available topic branches.
|
|||||||
names = all.keys()
|
names = all.keys()
|
||||||
names.sort()
|
names.sort()
|
||||||
|
|
||||||
if not opt.all and not args:
|
|
||||||
# No -a and no specific projects listed; try to filter the
|
|
||||||
# results down to only the majority of projects.
|
|
||||||
#
|
|
||||||
n = []
|
|
||||||
for name in names:
|
|
||||||
i = all[name]
|
|
||||||
if i.IsCurrent \
|
|
||||||
or 80 <= (100 * len(i.projects)) / project_cnt:
|
|
||||||
n.append(name)
|
|
||||||
names = n
|
|
||||||
|
|
||||||
if not names:
|
if not names:
|
||||||
print >>sys.stderr, ' (no branches)'
|
print >>sys.stderr, ' (no branches)'
|
||||||
return
|
return
|
||||||
@ -126,7 +109,7 @@ Summarizes the currently available topic branches.
|
|||||||
hdr('%c%c %-*s' % (current, published, width, name))
|
hdr('%c%c %-*s' % (current, published, width, name))
|
||||||
out.write(' |')
|
out.write(' |')
|
||||||
|
|
||||||
if in_cnt < project_cnt and (in_cnt == 1 or opt.all):
|
if in_cnt < project_cnt and (in_cnt == 1):
|
||||||
fmt = out.write
|
fmt = out.write
|
||||||
paths = []
|
paths = []
|
||||||
if in_cnt < project_cnt - in_cnt:
|
if in_cnt < project_cnt - in_cnt:
|
||||||
|
Loading…
Reference in New Issue
Block a user