Patchwork D7314: revlog: no longer return the nodemap after parsing

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 1:55 a.m.
Message ID <8cc61480f7bbd527c9120183d260c42c@localhost.localdomain>
Download mbox | patch
Permalink /patch/43009/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 1:55 a.m.
Closed by commit rHG3d6507e78672: revlog: no longer return the nodemap after parsing (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7314?vs=17730&id=17827

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7314/new/

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

AFFECTED FILES
  contrib/perf.py
  mercurial/revlog.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -252,7 +252,7 @@ 
             n += 1
 
         index = revlogoldindex(index)
-        return index, index.nodemap, None
+        return index, None
 
     def packentry(self, entry, node, version, rev):
         if gettype(entry[0]):
@@ -299,7 +299,7 @@ 
     def parseindex(self, data, inline):
         # call the C implementation to parse the index data
         index, cache = parsers.parse_index2(data, inline)
-        return index, index.nodemap, cache
+        return index, cache
 
     def packentry(self, entry, node, version, rev):
         p = indexformatng_pack(*entry)
@@ -552,8 +552,8 @@ 
             raise error.RevlogError(
                 _(b"index %s is corrupted") % self.indexfile
             )
-        self.index, nodemap, self._chunkcache = d
-        self.nodemap = self._nodecache = nodemap
+        self.index, self._chunkcache = d
+        self.nodemap = self._nodecache = self.index.nodemap
         if not self._chunkcache:
             self._chunkclear()
         # revnum -> (chain-length, sum-delta-length)
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -2592,7 +2592,7 @@ 
                 index[rev]
 
     def resolvenode(node):
-        nodemap = revlogio.parseindex(data, inline)[1]
+        nodemap = getattr(revlogio.parseindex(data, inline)[0], 'nodemap', None)
         # This only works for the C code.
         if nodemap is None:
             return
@@ -2603,7 +2603,7 @@ 
             pass
 
     def resolvenodes(nodes, count=1):
-        nodemap = revlogio.parseindex(data, inline)[1]
+        nodemap = getattr(revlogio.parseindex(data, inline)[0], 'nodemap', None)
         if nodemap is None:
             return