mercurial/scmutil.py
changeset 37680 e743b8524d60
parent 37679 ab828755e1ea
child 37708 8e8541610d85
--- a/mercurial/scmutil.py	Fri Apr 13 11:00:30 2018 -0700
+++ b/mercurial/scmutil.py	Fri Apr 13 22:55:01 2018 -0700
@@ -443,6 +443,10 @@
     repo.changelog.rev(node)  # make sure node isn't filtered
     return node
 
+def shortesthexnodeidprefix(repo, hexnode, minlength=1):
+    """Find the shortest unambiguous prefix that matches hexnode."""
+    return repo.changelog.shortest(hexnode, minlength)
+
 def isrevsymbol(repo, symbol):
     """Checks if a symbol exists in the repo.