Mercurial > public > mercurial-scm > hg
comparison hgext/phabricator.py @ 43858:b0867b7751ba
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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 22 Nov 2019 23:43:59 -0500 |
parents | 74ec6ca0eb75 |
children | a7c4bcf7018a |
comparison
equal
deleted
inserted
replaced
43857:74ec6ca0eb75 | 43858:b0867b7751ba |
---|---|
128 b'phabricator.action.skipped': b'magenta', | 128 b'phabricator.action.skipped': b'magenta', |
129 b'phabricator.action.updated': b'magenta', | 129 b'phabricator.action.updated': b'magenta', |
130 b'phabricator.desc': b'', | 130 b'phabricator.desc': b'', |
131 b'phabricator.drev': b'bold', | 131 b'phabricator.drev': b'bold', |
132 b'phabricator.node': b'', | 132 b'phabricator.node': b'', |
133 b'phabricator.status.abandoned': b'magenta dim', | |
134 b'phabricator.status.accepted': b'green bold', | |
135 b'phabricator.status.closed': b'green', | |
136 b'phabricator.status.needsreview': b'yellow', | |
137 b'phabricator.status.needsrevision': b'red', | |
138 b'phabricator.status.changesplanned': b'red', | |
133 } | 139 } |
134 | 140 |
135 _VCR_FLAGS = [ | 141 _VCR_FLAGS = [ |
136 ( | 142 ( |
137 b'', | 143 b'', |
1726 for rev in revsbydrevid[int(drev[b'id'])]: | 1732 for rev in revsbydrevid[int(drev[b'id'])]: |
1727 drevsbyrev[rev] = drev | 1733 drevsbyrev[rev] = drev |
1728 | 1734 |
1729 def phabstatus(ctx): | 1735 def phabstatus(ctx): |
1730 drev = drevsbyrev[ctx.rev()] | 1736 drev = drevsbyrev[ctx.rev()] |
1731 ui.write(b"\n%(uri)s %(statusName)s\n" % drev) | 1737 status = ui.label( |
1738 b'%(statusName)s' % drev, | |
1739 b'phabricator.status.%s' % _getstatusname(drev), | |
1740 ) | |
1741 ui.write(b"\n%s %s\n" % (drev[b'uri'], status)) | |
1732 | 1742 |
1733 revs -= smartset.baseset(unknownrevs) | 1743 revs -= smartset.baseset(unknownrevs) |
1734 revdag = graphmod.dagwalker(repo, revs) | 1744 revdag = graphmod.dagwalker(repo, revs) |
1735 | 1745 |
1736 ui.setconfig(b'experimental', b'graphshorten', True) | 1746 ui.setconfig(b'experimental', b'graphshorten', True) |