compat: more straight forward alias for old template names
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 03 Mar 2018 22:12:35 -0500
changeset 3512 57033b0bd347
parent 3509 174d966e1eaa
child 3513 b1cc19e5ef24
compat: more straight forward alias for old template names The template registration have significantly changed in core:7b74afec6772. We take simpler approach to define the alias in a way that works for all versions.
hgext3rd/evolve/templatekw.py
--- a/hgext3rd/evolve/templatekw.py	Fri Mar 02 16:31:08 2018 -0500
+++ b/hgext3rd/evolve/templatekw.py	Sat Mar 03 22:12:35 2018 -0500
@@ -48,7 +48,7 @@
                                    **args)
 
 if util.safehasattr(templatekw, 'showpredecessors'):
-    eh.templatekw("precursors")(templatekw.showpredecessors)
+    templatekw.keywords["precursors"] = templatekw.showpredecessors
 else:
     # for version <= hg4.3
     def closestprecursors(repo, nodeid):
@@ -97,7 +97,7 @@
     return directsuccessorssets(repo, nodeid)
 
 if util.safehasattr(templatekw, 'showsuccessorssets'):
-    eh.templatekw("successors")(templatekw.showsuccessorssets)
+    templatekw.keywords["successors"] = templatekw.showsuccessorssets
 else:
     # for version <= hg4.3