Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: git_cl.py

Issue 9959073: Allow longer branch names to be center justified with git cl status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 130176)
+++ git_cl.py (working copy)
@@ -799,11 +799,17 @@
if show_branches:
branches = RunGit(['for-each-ref', '--format=%(refname)', 'refs/heads'])
if branches:
- print 'Branches associated with reviews:'
+ alignment = 5
M-A Ruel 2012/04/02 19:56:25 You can code it even shorter with: print 'Branche
+ branch_info = []
for branch in sorted(branches.splitlines()):
cl = Changelist(branchref=branch)
- print " %10s: %s" % (cl.GetBranch(), cl.GetIssue())
+ alignment = max(alignment, len(cl.GetBranch()))
+ branch_info.append([cl.GetBranch(), cl.GetIssue()])
+ print 'Branches associated with reviews:'
+ for info in branch_info:
+ print " %*s: %s" % (alignment, info[0], info[1])
+
cl = Changelist()
if options.field:
if options.field.startswith('desc'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698