comparison hgext/transplant.py @ 36514:7b74afec6772

templatekw: switch non-showlist template keywords to new API
author Yuya Nishihara <yuya@tcha.org>
date Sun, 25 Feb 2018 13:40:46 +0900
parents 6ea0b78ddcac
children 5bc7ff103081
comparison
equal deleted inserted replaced
36513:6ad140dc4269 36514:7b74afec6772
742 return smartset.baseset([r for r in s if 742 return smartset.baseset([r for r in s if
743 repo[r].extra().get('transplant_source')]) 743 repo[r].extra().get('transplant_source')])
744 744
745 templatekeyword = registrar.templatekeyword() 745 templatekeyword = registrar.templatekeyword()
746 746
747 @templatekeyword('transplanted') 747 @templatekeyword('transplanted', requires={'ctx'})
748 def kwtransplanted(repo, ctx, **args): 748 def kwtransplanted(context, mapping):
749 """String. The node identifier of the transplanted 749 """String. The node identifier of the transplanted
750 changeset if any.""" 750 changeset if any."""
751 ctx = context.resource(mapping, 'ctx')
751 n = ctx.extra().get('transplant_source') 752 n = ctx.extra().get('transplant_source')
752 return n and nodemod.hex(n) or '' 753 return n and nodemod.hex(n) or ''
753 754
754 def extsetup(ui): 755 def extsetup(ui):
755 cmdutil.unfinishedstates.append( 756 cmdutil.unfinishedstates.append(