mercurial/templatefuncs.py
changeset 37680 e743b8524d60
parent 37674 f83cb91b052e
child 37708 8e8541610d85
--- a/mercurial/templatefuncs.py	Fri Apr 13 11:00:30 2018 -0700
+++ b/mercurial/templatefuncs.py	Fri Apr 13 22:55:01 2018 -0700
@@ -590,8 +590,8 @@
     # _partialmatch() of filtered changelog could take O(len(repo)) time,
     # which would be unacceptably slow. so we look for hash collision in
     # unfiltered space, which means some hashes may be slightly longer.
-    cl = context.resource(mapping, 'ctx')._repo.unfiltered().changelog
-    return cl.shortest(node, minlength)
+    repo = context.resource(mapping, 'ctx')._repo
+    return scmutil.shortesthexnodeidprefix(repo.unfiltered(), node, minlength)
 
 @templatefunc('strip(text[, chars])')
 def strip(context, mapping, args):