mercurial/templatefuncs.py
changeset 37865 da083d9fafab
parent 37859 66dc9db6ed2c
child 37931 faa41fd282d1
--- a/mercurial/templatefuncs.py	Wed May 02 22:56:10 2018 -0700
+++ b/mercurial/templatefuncs.py	Sat May 05 00:16:43 2018 -0700
@@ -608,7 +608,10 @@
             return hexnode
         if not node:
             return hexnode
-    return scmutil.shortesthexnodeidprefix(repo, node, minlength)
+    try:
+        return scmutil.shortesthexnodeidprefix(repo, node, minlength)
+    except error.RepoLookupError:
+        return hexnode
 
 @templatefunc('strip(text[, chars])')
 def strip(context, mapping, args):