Read-only tree can't read head (Re: Web interface update)

Lalo Martins lalo at
Sat May 21 18:02:02 BST 2005

Martin Pool wrote:
> On  9 May 2005, Chris McCormick <chris at> wrote:
>>Your web user now needs write access to .bzr so locking can work.
>   Branch(base, lock_mode='r') 
> if you want only read access to it.


while working with bzrweb today, I noticed this is not sufficient.  It 
allows you to view logs and files in past revisions, etc, but if you try 
to view something in the head, you get something like:
Traceback (most recent call last):
   File "", line 73, in showPage
     return (200, "Script output follows") + \
   File "/repo/src/bzrweb.lalo/", line 153, in showPage
     patchtext = self.webcommands[arguments[0]](arguments[2:])
   File "/repo/src/bzrweb.lalo/", line 431, in export
     tree = b.working_tree()
   File "/repo/src/", line 587, in working_tree
     return WorkingTree(self.base, self.read_working_inventory())
   File "/repo/src/", line 40, in __init__
   File "/repo/src/", line 97, in 
     self._statcache = statcache.update_cache(self.basedir, self.inventory)
   File "/repo/src/", line 209, in update_cache
     return _update_cache_from_list(basedir, cache, 
   File "/repo/src/", line 266, in 
     _write_cache(basedir, cache.itervalues(), dangerfiles)
   File "/repo/src/", line 114, in _write_cache
     outf = AtomicFile(cachefn, 'wb')
   File "/repo/src/", line 39, in __init__
     self.f = open(self.tmpfilename, mode)
IOError: [Errno 13] Permission denied: 

where basically, the WorkingTree is trying to update its stat cache, and 
write the updated cache to .bzr.

I figure we need a ReadOnlyWorkingTree?

                                                Lalo Martins
   It doesn't bother me that people say things like
    "you'll never get anywhere with this attitude".
    In a few decades, it will make a good paragraph
       in my biography. You know, for a laugh.
--                mailto:lalo at
          pgp key:

More information about the bazaar mailing list