Crash (and corruption?) after reverting an added directory

Robert Collins robert.collins at canonical.com
Sun Apr 26 23:21:36 BST 2009


On Sun, 2009-04-26 at 14:56 -0400, Greg Ward wrote:
> Hi all --
> 
> I just provoked a crash with a slightly confusing sequence of
> add/mv/revert commands.  Here's the scenario: I have a project with
> this layout:
>   a.py
>   b.py
>   sub/c.py
> 
> I want to move the code into pkg/ and wind up like this:
>   pkg/a.py
>   pkg/b.py
>   pkg/sub/c.py
> 
> Being a Bazaar newbie, I forgot to use "bzr mv" and used plain "mv" by
> mistake.  When I tried to correct my mistake, I got in a horrible
> sticky mess and now Bazaar is wedged: it always raises an exception in
> this branch.
> 
> Here's how to reproduce the bug.  It fails the same way with 1.13 and
> 1.14rc2 (both on Ubuntu intrepid using packages from the bzr PPAs):
> 
> # setup initial layout:
> bzr init bzrcrash
> cd bzrcrash
> touch a.py b.py
> mkdir sub
> touch sub/c.py
> bzr add
> bzr ci -m"initial revision"
> 
> # move code into pkg/, the wrong way
> mkdir pkg
> mv *.py pkg
> mv sub pkg
> 
> # oops! I should have used "bzr mv"... try to fix my mistake, take 1
> bzr revert .

Just FYI, 'bzr revert .' preserves merge data, generally you just want
'bzr revert' (to get the default of 'revert everything').

> bzr mv *.py pkg    # "ERROR: Could not move to pkg: pkg is not versioned."
>
> # oops! bzr tracks directories, so I have to add the directory first
> bzr add pkg

I consider this a UI bug. We should fix it, it makes this case awkward.

> # oops! that recursively adds all the files already in pkg, so now I have
> # a.py and pkg/a.py -- get rid of the duplicates in pkg/
> rm pkg/*.py
> rm -r pkg/sub
> 
> # ok, *now* I can get bzr to move my files, right?
> bzr mv *.py pkg          # ERROR: Could not move a.py => a.py: Target
> is already versioned.
> 
> # argh: just rm'ing the files did not remove them from bzr's radar, of
> course. duh.
> # rewind again.
> bzr revert .

Its possible the . again is confusing things, though I wouldn't expect
that. Regardless:
I'm going to file three new bugs about this.
(that pkg isn't automatically versioned for you,
 that it breaks when you ran some commands
 that the breakage was recorded to disk and not blocked)
I hope you don't mind if I copy your mail's instructions as the content
of a chunk of the bug contents.

> This last "revert" seems to be where everything goes off the rails.
> Specifically, the output from that command is
> 
> -D  pkg/
> -   pkg/a.py
> -   pkg/b.py
> -   pkg/sub
> bzr: ERROR: An inconsistent delta was supplied involving 'pkg/sub',
> 'sub-20090426182712-gp9wgeideu9o5x1f-4'
> reason: The file id was deleted but its children were not deleted.

> That's a pretty inscrutable error message to a newbie like me.  But it
> gets worse:


> Questions:
>   * is this a known bug? or should I file a bug report?
>   * how can I recover my working branch and get back to work?

As Matt said, only the working tree state, where changes are accumulated
is confused.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090427/4aa591f2/attachment-0001.pgp 


More information about the bazaar mailing list