##// END OF EJS Templates
phabricator: add a "phabstatus" template keyword...
Denis Laxalde -
r44292:79c01212 default
parent child Browse files
Show More
@@ -1684,6 +1684,28 b' def template_review(context, mapping):'
1684 1684 return None
1685 1685
1686 1686
1687 @eh.templatekeyword(b'phabstatus', requires={b'ctx', b'repo', b'ui'})
1688 def template_status(context, mapping):
1689 """:phabstatus: String. Status of Phabricator differential.
1690 """
1691 ctx = context.resource(mapping, b'ctx')
1692 repo = context.resource(mapping, b'repo')
1693 ui = context.resource(mapping, b'ui')
1694
1695 rev = ctx.rev()
1696 try:
1697 drevid = getdrevmap(repo, [rev])[rev]
1698 except KeyError:
1699 return None
1700 drevs = callconduit(ui, b'differential.query', {b'ids': [drevid]})
1701 for drev in drevs:
1702 if int(drev[b'id']) == drevid:
1703 return templateutil.hybriddict(
1704 {b'url': drev[b'uri'], b'status': drev[b'statusName'],}
1705 )
1706 return None
1707
1708
1687 1709 @show.showview(b'phabstatus', csettopic=b'work')
1688 1710 def phabstatusshowview(ui, repo, displayer):
1689 1711 """Phabricator differiential status"""
General Comments 0
You need to be logged in to leave comments. Login now