Patchwork D8408: nodemap: skip persistent nodemap warming for revlog not using it

login
register
mail settings
Submitter phabricator
Date April 14, 2020, 3:48 p.m.
Message ID <differential-rev-PHID-DREV-342dwqab52msztw6gvcc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46084/
State Superseded
Headers show

Comments

phabricator - April 14, 2020, 3:48 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Before this patch, the usual checking (especially, inline-ess) were not
  performed when warming the cache through `hg debugupdatecache`.
  
  This is now fixed.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -112,6 +112,11 @@ 
     To be used for updating the nodemap on disk outside of a normal transaction
     setup (eg, `debugupdatecache`).
     """
+    if revlog._inline:
+        return  # inlined revlog are too small for this to be relevant
+    if revlog.nodemap_file is None:
+        return  # we do not use persistent_nodemap on this revlog
+
     notr = _NoTransaction()
     _persist_nodemap(notr, revlog)
     for k in sorted(notr._postclose):