hgext/show.py
changeset 37680 e743b8524d60
parent 37134 6890b7e991a4
child 37708 8e8541610d85
--- a/hgext/show.py	Fri Apr 13 11:00:30 2018 -0700
+++ b/hgext/show.py	Fri Apr 13 22:55:01 2018 -0700
@@ -45,6 +45,7 @@
     registrar,
     revset,
     revsetlang,
+    scmutil,
 )
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
@@ -447,8 +448,10 @@
     if not revs:
         return minlen
     # don't use filtered repo because it's slow. see templater.shortest().
-    cl = repo.unfiltered().changelog
-    return max(len(cl.shortest(hex(cl.node(r)), minlen)) for r in revs)
+    cl = repo.changelog
+    return max(len(scmutil.shortesthexnodeidprefix(repo.unfiltered(),
+                                                   hex(cl.node(r)),
+                                                   minlen)) for r in revs)
 
 # Adjust the docstring of the show command so it shows all registered views.
 # This is a bit hacky because it runs at the end of module load. When moved