Patchwork D7318: revlog: deprecate the _nodecache attribute (API)

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

Comments

phabricator - Nov. 9, 2019, 1:56 a.m.
Closed by commit rHGda4afbbbe44a: revlog: deprecate the _nodecache attribute (API) (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/D7318?vs=17734&id=17831

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

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

AFFECTED FILES
  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
@@ -388,7 +388,6 @@ 
         # Mapping of partial identifiers to full nodes.
         self._pcache = {}
         # Mapping of revision integer to full node.
-        self._nodecache = None
         self._nodepos = None
         self._compengine = b'zlib'
         self._compengineopts = {}
@@ -553,7 +552,7 @@ 
                 _(b"index %s is corrupted") % self.indexfile
             )
         self.index, self._chunkcache = d
-        self.nodemap = self._nodecache = self.index.nodemap
+        self.nodemap = self.index.nodemap
         if not self._chunkcache:
             self._chunkclear()
         # revnum -> (chain-length, sum-delta-length)
@@ -632,6 +631,12 @@ 
             self.rev(node0)
         return self.index.nodemap
 
+    @property
+    def _nodecache(self):
+        msg = "revlog._nodecache is deprecated, use revlog.index.nodemap"
+        util.nouideprecwarn(msg, b'5.3', stacklevel=2)
+        return self.index.nodemap
+
     def hasnode(self, node):
         try:
             self.rev(node)