# HG changeset patch # User Joerg Sonnenberger # Date 1559349014 -7200 # Node ID 4d2f8c99f23a836a13fcf8d00a4fe66d655246b4 # Parent 6292fe564b205b52853e7d8e644236e073ea2ac6 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. diff -r 6292fe564b20 -r 4d2f8c99f23a 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"""