Request for comments: bzr support in ConvertExtension

Patrick Mézard pmezard at gmail.com
Sat Sep 13 09:25:06 CDT 2008


Marek Kubica a écrit :
> Hi,
> 
> I recently created a Bazaar-plugin for Mercurial and would eventually
> like to get it merged into the mainline as I think it might be useful.
> 
> I forked the crew repository some days ago and have been hacking on it
> and today it has started working relatively nice.
> 
> Not knowing what the best way to share my changes was, I pushed my
> repository online: <http://xivilization.net/hg/crew-convert-bzr/>. I
> have made a lot of single commits with small steps, but maybe it would
> be better to merge these commits into a single one.

Hello Marek,

Sorry for the long silence, I finally had some time to look at the crash when converting bzr.dev repository. It's actually unrelated to ghost revision but comes from too strong expectations about how revision trees return changes between two revisions: when a directory is moved, there are no entries for moved files contained in the directory, which means we are missing a lot of them.

Here is a simple script reproducing the issue:

"""
bzr init test
cd test
mkdir foo
echo a > foo/a
bzr add foo
bzr ci -m addfoo
bzr mv foo bar
bzr ci -m movefoobar
bzr mv bar/a a
bzr ci -m movea
cd ..
hg convert test
"""

The directory move in the second revision was missed completely so further references to moved files fail afterwards. It appears you have to explore subdirectories to compute the right set of files upon every kind of actions, removal, copy and so forth. Also, actions order is becoming important since you can have a directory moved while one of it's subdirectory is moved elsewhere and a subfile is removed. Or things like that. Perhaps bzrlib already has some helpers to compute these kind of things, I don't know.

To debug this quickly on the bzr development tree, I added support for --rev option and cleaned up the existing tests. You can find the changes here:

	http://www.bitbucket.org/pmezard/hg-bzr/

Do not hesitate to create an account on bitbucket, I would give you write permission on this repo which might be easier than working with 2 public references.

--
Patrick Mézard


More information about the Mercurial-devel mailing list