[merge] Decent error when a path changes kind

John Arbash Meinel john at arbash-meinel.com
Thu Feb 1 16:23:41 GMT 2007


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

Tracy Camp wrote:
> 
...

> line 187, in _compare_trees
>     assert kind[0] == kind[1] or None in kind
> AssertionError
> 
> bzr 0.14.0 on python 2.4.3.final.0 (linux2)
> arguments: ['/opt/lsb/appbat/bin/bzr', 'merge']

I realize this is not the perfect solution, but the attached patch at
least changes the horrbile "AssertionError" into a nicely formatted
error that tells the use what they can do to get around the problem.

I'm not positive that it will give a good result for Tracy's needs,
since he is running 'bzr merge' rather than 'bzr status'. But I've
tested it for status, and it works quite well.

I'm surprised that 'merge' would cause this, since to this point we
haven't been able to commit a patch which does something like change the
kind of a path.

The new error is:
% bzr init
% echo a > a
% bzr add a
% bzr commit -m a
% rm a; mkdir a
% ../bzr status
bzr: ERROR: Path "a" changed kind from file to directory.
bzr does not currently support this without doing a delete and an add.
Please do:
  bzr rm a
  bzr add a

I don't think this is a great solution, but it is a really good
temporary fix until we get proper support for path kind changes.


I would like to hear what Robert and Martin think of Aaron's proposed
status output. I didn't feel like it was really the right layout, but I
could be convinced otherwise. (Actually, I think he was proposing it for
something other than status, but I don't remember exactly what command.
Maybe 'update'?)

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

iD8DBQFFwhQNJdeBCYSNAAMRAsvpAJ93xi3NWnN+k1K7u3/aCQiiPvnJwACfY8NP
SpRFHzqDeX8osscbR5VJCIE=
=DuS+
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kind_change_error.patch
Type: text/x-patch
Size: 12398 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070201/52d5c995/attachment.bin 


More information about the bazaar mailing list