[Pkg-bazaar-commits] ./bzr/unstable r844: - clean up imports of statcache

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:21:14 UTC 2009


------------------------------------------------------------
revno: 844
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-07-06 15:32:32 +1000
message:
  - clean up imports of statcache
modified:
  bzrlib/commands.py
  bzrlib/workingtree.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-07-04 05:12:59 +0000
+++ b/bzrlib/commands.py	2005-07-06 05:32:32 +0000
@@ -770,10 +770,10 @@
     """List files modified in working tree."""
     hidden = True
     def run(self):
-        import statcache
+        from bzrlib.statcache import update_cache, SC_SHA1
         b = find_branch('.')
         inv = b.read_working_inventory()
-        sc = statcache.update_cache(b, inv)
+        sc = update_cache(b, inv)
         basis = b.basis_tree()
         basis_inv = basis.inventory
         
@@ -787,7 +787,7 @@
             if not cacheentry:                 # deleted
                 continue
             ie = basis_inv[file_id]
-            if cacheentry[statcache.SC_SHA1] != ie.text_sha1:
+            if cacheentry[SC_SHA1] != ie.text_sha1:
                 path = inv.id2path(file_id)
                 print path
 
@@ -1316,9 +1316,9 @@
     For testing only."""
     hidden = True
     def run(self):
-        import statcache
+        from bzrlib.statcache import update_cache
         b = find_branch('.')
-        statcache.update_cache(b.base, b.read_working_inventory())
+        update_cache(b.base, b.read_working_inventory())
 
 
 

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2005-05-12 02:18:48 +0000
+++ b/bzrlib/workingtree.py	2005-07-06 05:32:32 +0000
@@ -20,7 +20,6 @@
 import bzrlib.tree
 from errors import BzrCheckError
 from trace import mutter
-import statcache
 
 class WorkingTree(bzrlib.tree.Tree):
     """Working copy tree.
@@ -92,9 +91,9 @@
     
 
     def _update_statcache(self):
-        import statcache
         if not self._statcache:
-            self._statcache = statcache.update_cache(self.basedir, self.inventory)
+            from bzrlib.statcache import update_cache
+            self._statcache = update_cache(self.basedir, self.inventory)
 
     def get_file_size(self, file_id):
         import os, stat
@@ -102,7 +101,8 @@
 
 
     def get_file_sha1(self, file_id):
-        return self._statcache[file_id][statcache.SC_SHA1]
+        from bzrlib.statcache import SC_SHA1
+        return self._statcache[file_id][SC_SHA1]
 
 
     def file_class(self, filename):



More information about the Pkg-bazaar-commits mailing list