D4003: index: write expression for encoded revision index consistently

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Aug 1 17:03:51 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG37161dc600c5: index: write expression for encoded revision index consistently (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4003?vs=9695&id=9745

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

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1062,7 +1062,7 @@
 		v = n->children[k];
 
 		if (v == 0) {
-			n->children[k] = -rev - 1;
+			n->children[k] = -(rev + 1);
 			return 0;
 		}
 		if (v < 0) {
@@ -1072,7 +1072,7 @@
 			if (oldnode == NULL)
 				return -1;
 			if (!memcmp(oldnode, node, 20)) {
-				n->children[k] = -rev - 1;
+				n->children[k] = -(rev + 1);
 				return 0;
 			}
 			noff = nt_new(self);



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


More information about the Mercurial-devel mailing list