From patchwork Fri Nov 8 09:31:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: D7320: revlog: clean up the node of all revision stripped in the C code From: phabricator X-Patchwork-Id: 42916 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 8 Nov 2019 09:31:44 +0000 marmoute created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY For some obscure reason, the loop cleaning up node was skipping the first element… I cannot see a reason for it. The overall code is running fine nevertheless because the node are also explicitly deleted from python. We want to delete this explicit deletion, so we need to fix that code first. This work is part of a refactoring to unify the revlog index and the nodemap. This unification prepare the use of a persistent nodemap. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7320 AFFECTED FILES mercurial/cext/revlog.c CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -2489,7 +2489,7 @@ if (self->ntinitialized) { Py_ssize_t i; - for (i = start + 1; i < self->length; i++) { + for (i = start; i < self->length; i++) { const char *node = index_node_existing(self, i); if (node == NULL) return -1;