Patchwork D4104: index: return False for "len(index) in index"

login
register
mail settings
Submitter phabricator
Date Aug. 5, 2018, 1:04 p.m.
Message ID <1c452ec1ef717ebe0a46216ce0e5ce52@localhost.localdomain>
Download mbox | patch
Permalink /patch/33265/
State Not Applicable
Headers show

Comments

phabricator - Aug. 5, 2018, 1:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGaa33988ad8ab: index: return False for &quot;len(index) in index&quot; (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4104?vs=9907&id=9928

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

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




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

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1393,7 +1393,7 @@ 
 
 	if (PyInt_Check(value)) {
 		long rev = PyInt_AS_LONG(value);
-		return rev >= -1 && rev < index_length(self) + 1;
+		return rev >= -1 && rev < index_length(self);
 	}
 
 	if (node_check(value, &node) == -1)