Patchwork [3,of,3] revlog: obtain the first node at the lowest layer while building pure nodemap

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2018, 4:41 a.m.
Message ID <862795da77333d388efb.1534480905@mimosa>
Download mbox | patch
Permalink /patch/33815/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 17, 2018, 4:41 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1534478853 -32400
#      Fri Aug 17 13:07:33 2018 +0900
# Node ID 862795da77333d388efbda161e012336ff4237bf
# Parent  a492553fb5277889521c5400d59b51fe238dc4d8
revlog: obtain the first node at the lowest layer while building pure nodemap

Just for clarity. This doesn't matter in practice since changelog.nodemap
is accessed *before* filtered revisions get ready.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1109,7 +1109,8 @@  class revlog(object):
     def nodemap(self):
         if self.index:
             # populate mapping down to the initial node
-            self.rev(self.node(0))
+            node0 = self.index[0][7]  # get around changelog filtering
+            self.rev(node0)
         return self._nodecache
 
     def hasnode(self, node):