[MERGE] Hidden bug in `bzr info` when dirstate tree is write-locked

John Arbash Meinel john at arbash-meinel.com
Mon Apr 23 18:13:56 BST 2007

Alexander Belchenko wrote:
> John Arbash Meinel ?8H5B:


>> So instead I went with the attached diff. It still raises
>> "knownFailure()" for win32, but only after running all of the tests. It
>> also makes sure that 'bzr info' is actually failing at the right time.
> I wonder if we need to check format of WT in addition to checking platform,
> i.e.
> @@ -1285,6 +1291,10 @@
>              lco_tree.branch.repository.lock_write()
>              lco_tree.branch.unlock()
> +        if sys.platform == 'win32':
> +            self.knownFailure('Win32 cannot run "bzr info"'
> +                              ' when the tree is locked.')
> +
> ^-- here add check for tree format before generate knownFailure?
> [µ]

We could, but for now I'm just checking earlier that "bzr info" is failing.

Right now you can see that I do:
+        if tree_locked and sys.platform == 'win32':
+            # Arguably neither can Linux, but for now OS Locks are
+            # not exclusive in-process.
+            args = command_string.split(' ')
+            self.run_bzr_error([], 'info', *args)
+            return

Which means that if it starts *working*, the test will start failing,
which is a clue that it needs to be updated. I realize it isn't
completely obvious, because the place checking for the actual failure is
decoupled from the place that is raising "knownFailure".

I suppose we could change the check to:

if (tree_locked and sys.platform == 'win32'
    and isinstance(tree, WorkingTree4)):

Thoughts? Should it be updated and merged for 0.16?


More information about the bazaar mailing list