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

login
register
mail settings
Submitter phabricator
Date March 11, 2020, 1:34 a.m.
Message ID <a1c534284d3fb694dbc90dde71425017@localhost.localdomain>
Download mbox | patch
Permalink /patch/45681/
State Not Applicable
Headers show

Comments

phabricator - March 11, 2020, 1:34 a.m.
marmoute added a comment.
marmoute updated this revision to Diff 20677.


  rebase above latest default up to landed-D8182

REPOSITORY
  rHG Mercurial

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

BRANCH
  default

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: