[merge] Ignore write errors when creating hashcache
Martin Pool
mbp at canonical.com
Wed Dec 20 08:41:54 GMT 2006
On 19 Dec 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> 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?
I think that, with the comment you gave, it's ok. We don't want too
many delays in the test case.
> 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.
How about: if we get an exception, check access(basedir, W) and if the
base directory is writable then something is sufficiently strange
that it's worth giving a user-visible warning.
--
Martin
More information about the bazaar
mailing list