diff -r ab828755e1ea -r e743b8524d60 mercurial/scmutil.py --- 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.