[Pkg-bazaar-commits] ./bzr/unstable r489: - WorkingTree loads statcache in constructor and holds

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:15 UTC 2009


------------------------------------------------------------
revno: 489
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Thu 2005-05-12 12:18:48 +1000
message:
  - WorkingTree loads statcache in constructor and holds
    it permanently
modified:
  bzrlib/workingtree.py
-------------- next part --------------
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2005-05-11 04:57:13 +0000
+++ b/bzrlib/workingtree.py	2005-05-12 02:18:48 +0000
@@ -20,7 +20,7 @@
 import bzrlib.tree
 from errors import BzrCheckError
 from trace import mutter
-
+import statcache
 
 class WorkingTree(bzrlib.tree.Tree):
     """Working copy tree.
@@ -37,6 +37,7 @@
         self._inventory = inv
         self.basedir = basedir
         self.path2id = inv.path2id
+        self._update_statcache()
 
     def __iter__(self):
         """Iterate through file_ids for this tree.
@@ -44,7 +45,6 @@
         file_ids are in a WorkingTree if they are in the working inventory
         and the working file exists.
         """
-        self._update_statcache()
         inv = self._inventory
         for file_id in self._inventory:
             # TODO: This is slightly redundant; we should be able to just
@@ -83,7 +83,6 @@
         # files that have been deleted are excluded
         if not self.inventory.has_id(file_id):
             return False
-        self._update_statcache()
         if file_id in self._statcache:
             return True
         return os.path.exists(self.abspath(self.id2path(file_id)))
@@ -103,8 +102,6 @@
 
 
     def get_file_sha1(self, file_id):
-        import statcache
-        self._update_statcache()
         return self._statcache[file_id][statcache.SC_SHA1]
 
 



More information about the Pkg-bazaar-commits mailing list