[PATCH] dirstate: clear util._fspathcache in __init__ and invalidate

Simon Heimberg simohe at besonet.ch
Thu Aug 13 09:41:24 CDT 2009


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1250174455 -7200
# Node ID 0125e93afa6ce133080ff8fbe38edb094b760bb5
# Parent  cb2785c014b0241da4691bfa14b3643349c03db1
dirstate: clear util._fspathcache in __init__ and invalidate

_fspathcache stores information about files in dirstate
so clear it for having a defined state
especially useful on tools which do several commands in one python instance
(as tortoisehg)

diff -r cb2785c014b0 -r 0125e93afa6c mercurial/dirstate.py
--- a/mercurial/dirstate.py	Don Aug 13 16:40:19 2009 +0200
+++ b/mercurial/dirstate.py	Don Aug 13 16:40:55 2009 +0200
@@ -44,6 +44,7 @@
         self._dirty = False
         self._dirtypl = False
         self._ui = ui
+        util._fspathcache.clear()
 
     @propertycache
     def _map(self):
@@ -218,6 +219,7 @@
             if a in self.__dict__:
                 delattr(self, a)
         self._dirty = False
+        util._fspathcache.clear()
 
     def copy(self, source, dest):
         """Mark dest as a copy of source. Unmark dest if source is None.


More information about the Mercurial-devel mailing list