Patchwork [2,of,7] revlog: document cext oddities in terms of object/caches

login
register
mail settings
Submitter Boris Feld
Date Jan. 28, 2019, 8:10 p.m.
Message ID <dbc0d2061b0584c423f4.1548706254@localhost.localdomain>
Download mbox | patch
Permalink /patch/38141/
State Accepted
Headers show

Comments

Boris Feld - Jan. 28, 2019, 8:10 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1548458522 18000
#      Fri Jan 25 18:22:02 2019 -0500
# Node ID dbc0d2061b0584c423f4ecf007cd0125e16b11d1
# Parent  f39f3732ef42fe901b418e23433475076b599757
# EXP-Topic perf-ext
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r dbc0d2061b05
revlog: document cext oddities in terms of object/caches

This clarify why we just call clearcaches on a single object.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -607,6 +607,9 @@  class revlog(object):
         self._pcache = {}
 
         try:
+            # If we are using the native C version, you are in a fun case
+            # where self.index, self.nodemap and self._nodecaches is the same
+            # object.
             self._nodecache.clearcaches()
         except AttributeError:
             self._nodecache = {nullid: nullrev}