D4420: shortest: fix an off-by-1 when disambiguating against revnums

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Aug 30 08:07:23 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG570fca90d556: shortest: fix an off-by-1 when disambiguating against revnums (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4420?vs=10660&id=10671

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

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
@@ -475,7 +475,7 @@
         # if we are a pure int, then starting with zero will not be
         # confused as a rev; or, obviously, if the int is larger
         # than the value of the tip rev
-        if prefix[0:1] == b'0' or i > len(repo):
+        if prefix[0:1] == b'0' or i >= len(repo):
             return False
         return True
     except ValueError:



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


More information about the Mercurial-devel mailing list