I agree, Alexander, this sort of bug is a very annoying consequence of using OS locks, and I would really hope that a future working tree format can find a way to avoid them altogether.
In general I think this happens when we have aliasing of two objects pointing to a single on disk file, and *that* typically happens when we're passing around a filename rather than an object reference. For instance the tests commonly set up a branch using the object api, but then actually run the tests through a run_bzr command line, which will try to reopen them separately.
I agree, Alexander, this sort of bug is a very annoying consequence of using OS locks, and I would really hope that a future working tree format can find a way to avoid them altogether.
In general I think this happens when we have aliasing of two objects pointing to a single on disk file, and *that* typically happens when we're passing around a filename rather than an object reference. For instance the tests commonly set up a branch using the object api, but then actually run the tests through a run_bzr command line, which will try to reopen them separately.