mercurial/templatefuncs.py
changeset 38853 3588e41f796d
parent 38449 bc8d925342f0
child 39310 a2a5d4ad5276
--- a/mercurial/templatefuncs.py	Fri Jul 20 14:36:42 2018 -0700
+++ b/mercurial/templatefuncs.py	Tue Apr 17 11:16:59 2018 -0700
@@ -596,7 +596,7 @@
             yield sep
         yield argstr
 
-@templatefunc('shortest(node, minlength=4)', requires={'repo'})
+@templatefunc('shortest(node, minlength=4)', requires={'repo', 'cache'})
 def shortest(context, mapping, args):
     """Obtain the shortest representation of
     a node."""
@@ -629,8 +629,9 @@
             return hexnode
         if not node:
             return hexnode
+    cache = context.resource(mapping, 'cache')
     try:
-        return scmutil.shortesthexnodeidprefix(repo, node, minlength)
+        return scmutil.shortesthexnodeidprefix(repo, node, minlength, cache)
     except error.RepoLookupError:
         return hexnode