Patchwork D8174: nodemap: refresh the persistent data on nodemap creation

login
register
mail settings
Submitter phabricator
Date March 11, 2020, 3:42 p.m.
Message ID <276288a04aed3267de67caf521c47a4c@localhost.localdomain>
Download mbox | patch
Permalink /patch/45696/
State Not Applicable
Headers show

Comments

phabricator - March 11, 2020, 3:42 p.m.
Closed by commit rHG87b327de772c: nodemap: refresh the persistent data on nodemap creation (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8174?vs=20677&id=20689

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

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

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
@@ -760,7 +760,20 @@ 
         self._chainbasecache.clear()
         self._chunkcache = (0, b'')
         self._pcache = {}
+        self._nodemap_docket = None
         self.index.clearcaches()
+        # The python code is the one responsible for validating the docket, we
+        # end up having to refresh it here.
+        use_nodemap = (
+            not self._inline
+            and self.nodemap_file is not None
+            and util.safehasattr(self.index, 'update_nodemap_data')
+        )
+        if use_nodemap:
+            nodemap_data = nodemaputil.persisted_data(self)
+            if nodemap_data is not None:
+                self._nodemap_docket = nodemap_data[0]
+                self.index.update_nodemap_data(*nodemap_data)
 
     def rev(self, node):
         try: