templatekw: fix templatedata for 46
authorBoris Feld <boris.feld@octobus.net>
Wed, 04 Apr 2018 16:29:48 +0200
changeset 3644 4eea4a3ef11f
parent 3643 01108d67523f
child 3645 a2d06eba843f
templatekw: fix templatedata for 46
hgext3rd/evolve/templatekw.py
--- a/hgext3rd/evolve/templatekw.py	Sat Mar 31 11:53:09 2018 +0200
+++ b/hgext3rd/evolve/templatekw.py	Wed Apr 04 16:29:48 2018 +0200
@@ -312,7 +312,12 @@
     def fmt(d):
         nargs = args.copy()
         nargs.update(d[name])
-        return args['templ'](name, **nargs)
+        templ = args['templ']
+        # HG 4.6
+        if hasattr(templ, "generate"):
+            return templ.generate(name, nargs)
+        else:
+            return args['templ'](name, **nargs)
 
     # Generate a good enough string representation using templater
     gen = []