D7608: phabricator: color the status in the "phabstatus" view

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Wed Dec 11 23:24:45 EST 2019


mharbison72 created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I couldn't figure out strikethrough for "abandoned" like I've see with word
  diff.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7608

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -130,6 +130,12 @@
     b'phabricator.desc': b'',
     b'phabricator.drev': b'bold',
     b'phabricator.node': b'',
+    b'phabricator.status.abandoned': b'magenta dim',
+    b'phabricator.status.accepted': b'green bold',
+    b'phabricator.status.closed': b'green',
+    b'phabricator.status.needsreview': b'yellow',
+    b'phabricator.status.needsrevision': b'red',
+    b'phabricator.status.changesplanned': b'red',
 }
 
 _VCR_FLAGS = [
@@ -1728,7 +1734,11 @@
 
     def phabstatus(ctx):
         drev = drevsbyrev[ctx.rev()]
-        ui.write(b"\n%(uri)s %(statusName)s\n" % drev)
+        status = ui.label(
+            b'%(statusName)s' % drev,
+            b'phabricator.status.%s' % _getstatusname(drev),
+        )
+        ui.write(b"\n%s %s\n" % (drev[b'uri'], status))
 
     revs -= smartset.baseset(unknownrevs)
     revdag = graphmod.dagwalker(repo, revs)



To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-devel


More information about the Mercurial-devel mailing list