'bzr status' stats each file multiple times

Michael Ellerman michael at ellerman.id.au
Sun Dec 4 10:30:11 GMT 2005


On Fri, 2 Dec 2005 23:35, John A Meinel wrote:
> [snip]
> I've noticed that "bzr status" on an clean tree seems to take quite a
> while.
> [snip] 

Me too.

On my tree, it seems to recompute the sha1 for about 1/3 rd of
the files every time. It then caches them, but never writes the hashcache?
I also don't see the point of calling hashcache.scan() prematurely?

This makes it a bit quicker.

=== modified file 'bzrlib/workingtree.py'
--- bzrlib/workingtree.py
+++ bzrlib/workingtree.py
@@ -202,7 +202,7 @@
         # given path only.
         hc = self._hashcache = HashCache(basedir)
         hc.read()
-        hc.scan()
+        #hc.scan()
 
         if hc.needs_write:
             mutter("write hc")
@@ -908,6 +908,9 @@
         between multiple working trees, i.e. via shared storage, then we 
         would probably want to lock both the local tree, and the branch.
         """
+        if '_hashcache' in self.__dict__ and self._hashcache.needs_write:
+            self._hashcache.write()
+
         return self.branch.unlock()
 
     @needs_write_lock

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051204/fecade44/attachment.pgp 


More information about the bazaar mailing list