changeset 38023:5ac72e07692a

shortest: avoid magic number "41" As suggested by Yuya. Feel free to fold into D3502. Differential Revision: https://phab.mercurial-scm.org/D3531
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 11 May 2018 09:16:26 -0700
parents 312d7d14d44e
children bbdc1bc56e58
files mercurial/scmutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Fri May 11 07:31:51 2018 -0700
+++ b/mercurial/scmutil.py	Fri May 11 09:16:26 2018 -0700
@@ -466,7 +466,7 @@
     def disambiguate(prefix):
         """Disambiguate against revnums."""
         hexnode = hex(node)
-        for length in range(len(prefix), 41):
+        for length in range(len(prefix), len(hexnode) + 1):
             prefix = hexnode[:length]
             if not isrev(prefix):
                 return prefix