[merge] Ignore write errors when creating hashcache

John Arbash Meinel john at arbash-meinel.com
Tue Dec 19 17:13:13 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The attached patch adds a test case, and fixes bug #76299. Basically,
when we do 'bzr status' or the like, we check to see if the hashcache
needs updating, and if so, we write it.

But we can run 'bzr status' in a readonly directory.

The attached patch adds a test case for this, as well as fixing it so it
doesn't complain (though it does add an entry to .bzr.log).

I think the patch is usable as is, but I wanted to ask a few questions.

1) I have to hack tree._hashcache so that it realizes the tree is out of
date, and will want to write out a new cache. I wanted to test both of
our working tree implementations, so I put it in
bzrlib/tests/workingtree_implementations/test_readonly.py
I wrote it such that it shouldn't explicitly fail for other branch
formats, but it is a little hackish.
Does anyone have a better idea for how to do this, that doesn't involve
calling time.sleep(3) so that the clock rolls over?

2) I catch the exception and mutter(), should this be a user visible
warning? We could have a single line of:

  "warning: unable to update the hash-cache, is this tree readonly?"

I don't really need it, but I don't like silently suppressing errors.

Comments?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFiB2pJdeBCYSNAAMRAp0HAKDOcqbdLcVzJpUDAHPFDCPFNDwKlwCfXl4L
W1XkmhjW97YZ2FPbgAkP570=
=ru4W
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: status_in_non_writable.patch
Type: text/x-patch
Size: 8817 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061219/24172e1d/attachment.bin 


More information about the bazaar mailing list