Commit 92d67165 authored by rch@chromium.org's avatar rch@chromium.org

Allow longer branch names to be center justified with git cl status.

(Using "." instead of " " so that codereview shows the alignment)

Before:

% git cl status  
Branches associated with reviews:
..CloseIdleSpdySessions:.None
..CloseSockets:.9755011
..GetNegotiatedProtocol:.9958028
..LayeredSocketPool:.9861032
..ReleaseIdleSpdySessions:.9733017
..SSLClientSocket:.9616019
.......Spdy3:.9958023
...SpdyProxy:.None
...SpdyTests:.None
.......crash:.9809033
........leak:.None
......master:.None
.......spdy3:.9958023

After

% git cl status
Branches associated with reviews:
......CloseIdleSpdySessions:.None
...............CloseSockets:.9755011
......GetNegotiatedProtocol:.9958028
..........LayeredSocketPool:.9861032
....ReleaseIdleSpdySessions:.9733017
............SSLClientSocket:.9616019
......................Spdy3:.9958023
..................SpdyProxy:.None
..................SpdyTests:.None
......................crash:.9809033
.......................leak:.None
.....................master:.None
......................spdy3:.9958023

Review URL: http://codereview.chromium.org/9959073

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@130189 0039d316-1c4b-4281-b951-d872f2087c98
parent 0230d91a
......@@ -800,9 +800,11 @@ def CMDstatus(parser, args):
branches = RunGit(['for-each-ref', '--format=%(refname)', 'refs/heads'])
if branches:
print 'Branches associated with reviews:'
for branch in sorted(branches.splitlines()):
cl = Changelist(branchref=branch)
print " %10s: %s" % (cl.GetBranch(), cl.GetIssue())
changes = (Changelist(branchref=b) for b in branches.splitlines())
branches = dict((cl.GetBranch(), cl.GetIssue()) for cl in changes)
alignment = max(5, max(len(b) for b in branches))
for branch in sorted(branches):
print " %*s: %s" % (alignment, branch, branches[branch])
cl = Changelist()
if options.field:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment