Patchwork D10997: dirstate: remove seemingly unused `_filecache` attribute

login
register
mail settings
Submitter phabricator
Date July 7, 2021, 12:02 a.m.
Message ID <differential-rev-PHID-DREV-bhj6wwuznujz274s37zb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49311/
State Superseded
Headers show

Comments

phabricator - July 7, 2021, 12:02 a.m.
marmoute created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I am not able to find any code which tries to populate this dictionary.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/git/dirstate.py
  mercurial/dirstate.py
  mercurial/localrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2836,11 +2836,6 @@ 
         explicitly read the dirstate again (i.e. restoring it to a previous
         known good state)."""
         if hasunfilteredcache(self, 'dirstate'):
-            for k in self.dirstate._filecache:
-                try:
-                    delattr(self.dirstate, k)
-                except AttributeError:
-                    pass
             delattr(self.unfiltered(), 'dirstate')
 
     def invalidate(self, clearfilecache=False):
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -102,7 +102,6 @@ 
         self._dirty = False
         self._lastnormaltime = 0
         self._ui = ui
-        self._filecache = {}
         self._parentwriters = 0
         self._filename = b'dirstate'
         self._pendingfilename = b'%s.pending' % self._filename
@@ -396,12 +395,6 @@ 
         try:
             f.write(self._branch + b'\n')
             f.close()
-
-            # make sure filecache has the correct stat info for _branch after
-            # replacing the underlying file
-            ce = self._filecache[b'_branch']
-            if ce:
-                ce.refresh()
         except:  # re-raises
             f.discard()
             raise
diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -221,9 +221,6 @@ 
         # TODO support copies?
         return {}
 
-    # # TODO what the heck is this
-    _filecache = set()
-
     def pendingparentchange(self):
         # TODO: we need to implement the context manager bits and
         # correctly stage/revert index edits.