Make treestatus print closed reason
authorGregory Szorc <gps@mozilla.com>
Sun, 21 Jul 2013 23:59:37 -0700
changeset 14 1b090642a2d0a6c94491fb0453af956307a55818
parent 13 f5848ffdb34efbc499d52d7cb18f9f3b316fd85d
child 15 699ae892efef7dbd6ec0d0d45d6da82f824a5d27
push id5
push usergszorc@mozilla.com
push dateMon, 22 Jul 2013 06:59:57 +0000
Make treestatus print closed reason
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -235,17 +235,21 @@ def treestatus(ui, *trees, **opts):
 
     if trees:
         status = {k: status[k] for k in status if k in trees}
 
     longest = max(len(s) for s in status)
 
     for tree in sorted(status):
         s = status[tree]
-        ui.write('%s: %s\n' % (tree.rjust(longest), s.status))
+        if s.status == 'closed':
+            ui.write('%s: %s (%s)\n' % (tree.rjust(longest), s.status,
+                s.reason))
+        else:
+            ui.write('%s: %s\n' % (tree.rjust(longest), s.status))
 
 
 class remoterefs(dict):
     """Represents a remote refs file."""
 
     def __init__(self, repo):
         dict.__init__(self)
         self._repo = repo