Mercurial > public > mercurial-scm > hg
diff hgext/transplant.py @ 28540:012411b9940d
hgext: use templatekeyword to mark a function as template keyword
This patch replaces registration of template keyword function in
bundled extensions by registrar.templatekeyword decorator all at once.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 13 Mar 2016 05:17:06 +0900 |
parents | ec75c94262a5 |
children | d5883fd055c6 |
line wrap: on
line diff
--- a/hgext/transplant.py Sun Mar 13 05:17:06 2016 +0900 +++ b/hgext/transplant.py Sun Mar 13 05:17:06 2016 +0900 @@ -32,7 +32,6 @@ revlog, revset, scmutil, - templatekw, util, ) @@ -726,14 +725,16 @@ return revset.baseset([r for r in s if repo[r].extra().get('transplant_source')]) +templatekeyword = registrar.templatekeyword() + +@templatekeyword('transplanted') def kwtransplanted(repo, ctx, **args): - """:transplanted: String. The node identifier of the transplanted + """String. The node identifier of the transplanted changeset if any.""" n = ctx.extra().get('transplant_source') return n and nodemod.hex(n) or '' def extsetup(ui): - templatekw.keywords['transplanted'] = kwtransplanted cmdutil.unfinishedstates.append( ['transplant/journal', True, False, _('transplant in progress'), _("use 'hg transplant --continue' or 'hg update' to abort")])