Patchwork D3188: revlog: reset _nodepos after strip

login
register
mail settings
Submitter phabricator
Date April 9, 2018, 8:13 p.m.
Message ID <869ef87fc882a646ec1bf99c2a0cd525@localhost.localdomain>
Download mbox | patch
Permalink /patch/30611/
State Not Applicable
Headers show

Comments

phabricator - April 9, 2018, 8:13 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1ce7a55b09d1: revlog: reset _nodepos after strip (authored by joerg.sonnenberger, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3188?vs=7875&id=7913

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: joerg.sonnenberger, indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -818,6 +818,8 @@ 
             p = self._nodepos
             if p is None:
                 p = len(i) - 2
+            else:
+                assert p < len(i)
             for r in xrange(p, -1, -1):
                 v = i[r][7]
                 n[v] = r
@@ -2421,6 +2423,7 @@ 
             del self.nodemap[self.node(x)]
 
         del self.index[rev:-1]
+        self._nodepos = None
 
     def checksize(self):
         expected = 0