phabricator: color the status in the "phabstatus" view
I couldn't figure out strikethrough for "abandoned" like I've see with word
diff.
Differential Revision: https://phab.mercurial-scm.org/D7608
--- a/hgext/phabricator.py Wed Dec 11 23:16:42 2019 -0500
+++ b/hgext/phabricator.py Fri Nov 22 23:43:59 2019 -0500
@@ -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)