##// END OF EJS Templates
hgext: use templatekeyword to mark a function as template keyword...
FUJIWARA Katsunori -
r28540:012411b9 default
parent child Browse files
Show More
@@ -11,7 +11,7 b' from __future__ import absolute_import'
11 11
12 12 from mercurial import (
13 13 cmdutil,
14 templatekw,
14 registrar,
15 15 )
16 16 from mercurial.i18n import _
17 17
@@ -437,22 +437,22 b' def kwconverted(ctx, name):'
437 437 return subversion.revsplit(rev)[0]
438 438 return rev
439 439
440 templatekeyword = registrar.templatekeyword()
441
442 @templatekeyword('svnrev')
440 443 def kwsvnrev(repo, ctx, **args):
441 """:svnrev: String. Converted subversion revision number."""
444 """String. Converted subversion revision number."""
442 445 return kwconverted(ctx, 'svnrev')
443 446
447 @templatekeyword('svnpath')
444 448 def kwsvnpath(repo, ctx, **args):
445 """:svnpath: String. Converted subversion revision project path."""
449 """String. Converted subversion revision project path."""
446 450 return kwconverted(ctx, 'svnpath')
447 451
452 @templatekeyword('svnuuid')
448 453 def kwsvnuuid(repo, ctx, **args):
449 """:svnuuid: String. Converted subversion revision repository identifier."""
454 """String. Converted subversion revision repository identifier."""
450 455 return kwconverted(ctx, 'svnuuid')
451 456
452 def extsetup(ui):
453 templatekw.keywords['svnrev'] = kwsvnrev
454 templatekw.keywords['svnpath'] = kwsvnpath
455 templatekw.keywords['svnuuid'] = kwsvnuuid
456
457 457 # tell hggettext to extract docstrings from these functions:
458 458 i18nfunctions = [kwsvnrev, kwsvnpath, kwsvnuuid]
@@ -32,7 +32,6 b' from mercurial import ('
32 32 revlog,
33 33 revset,
34 34 scmutil,
35 templatekw,
36 35 util,
37 36 )
38 37
@@ -726,14 +725,16 b' def revsettransplanted(repo, subset, x):'
726 725 return revset.baseset([r for r in s if
727 726 repo[r].extra().get('transplant_source')])
728 727
728 templatekeyword = registrar.templatekeyword()
729
730 @templatekeyword('transplanted')
729 731 def kwtransplanted(repo, ctx, **args):
730 """:transplanted: String. The node identifier of the transplanted
732 """String. The node identifier of the transplanted
731 733 changeset if any."""
732 734 n = ctx.extra().get('transplant_source')
733 735 return n and nodemod.hex(n) or ''
734 736
735 737 def extsetup(ui):
736 templatekw.keywords['transplanted'] = kwtransplanted
737 738 cmdutil.unfinishedstates.append(
738 739 ['transplant/journal', True, False, _('transplant in progress'),
739 740 _("use 'hg transplant --continue' or 'hg update' to abort")])
General Comments 0
You need to be logged in to leave comments. Login now