templates: don't alias keywords directly stable
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 01 Jun 2019 02:30:14 +0200
branchstable
changeset 4659 4d2f8c99f23a
parent 4645 6292fe564b20
child 4660 b62ed7c69561
templates: don't alias keywords directly Putting the same function twice in the registry results in duplicate doc strings and therefore confusing "hg help template" output.
hgext3rd/evolve/templatekw.py
--- a/hgext3rd/evolve/templatekw.py	Sun May 05 22:48:41 2019 +0530
+++ b/hgext3rd/evolve/templatekw.py	Sat Jun 01 02:30:14 2019 +0200
@@ -39,14 +39,24 @@
         return templatekw.showlist('trouble', ctx.instabilities(), args,
                                    plural='troubles')
 
-templatekw.keywords["precursors"] = templatekw.showpredecessors
+_sp = templatekw.showpredecessors
+def showprecursors(context, mapping):
+    return _sp(context, mapping)
+showprecursors.__doc__ = _sp._origdoc
+_tk = templatekw.templatekeyword("precursors", requires=_sp._requires)
+_tk(showprecursors)
 
 def closestsuccessors(repo, nodeid):
     """ returns the closest visible successors sets instead.
     """
     return directsuccessorssets(repo, nodeid)
 
-templatekw.keywords["successors"] = templatekw.showsuccessorssets
+_ss = templatekw.showsuccessorssets
+def showsuccessors(context, mapping):
+    return _ss(context, mapping)
+showsuccessors.__doc__ = _ss._origdoc
+_tk = templatekw.templatekeyword("successors", requires=_ss._requires)
+_tk(showsuccessors)
 
 def _getusername(ui):
     """the default username in the config or None"""