D3531: shortest: avoid magic number "41"

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri May 11 22:54:34 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5ac72e07692a: shortest: avoid magic number "41" (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3531?vs=8637&id=8648

REVISION DETAIL
  https://phab.mercurial-scm.org/D3531

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -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



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list