views:

89

answers:

2

I have a small project which I started in bazaar, as an exercise to learn bzr. I've since decided I prefer Mecurial. How might I migrate this project to Hg?

+3  A: 

I believe your answer can be found here.

Essentially, all that's required is that you run

$ hg convert bzr-repository-URI Target-hg-dir
Mies
huh. When I try that I'm told "..\path\to\foo does not look like a Bazaar repository" even though it most definitely is. I'll follow up with the extension folks and see what I find.
matt wilkie
+2  A: 

Miles is correct, unless you are running Windows. The current Windows installers (1.6.3) do not include python bzrlib, so the convert fails with "..\path\to\foo does not look like a Bazaar repository".

After floundering around for awhile and failing to figure out how to acquire bzrlib and tell hg to use it, I used linux, which I have via an ubuntu vmware appliance.

I installed mercurial 1.6 from ppa (the default 1.4 doesn't have convert), enabled convert extension, and ran 'hg convert code/foo foo-from-bzr'. It appeared to work, giving me a summary of the log messages. I was confused for awhile that ./foo-from-bzr was empty except for an .hg directory. After floundering around for awhile I discovered that 'hg update' is needed. So, to recap:

# install mercurial 1.6 on ubuntu 10
sudo add-apt-repository ppa:mercurial-ppa/releases
sudo apt-get update
sudo apt-get install mercurial

# the actual conversion
hg convert path/to/foo-bzr-branch foo-hg
cd foo-hg
hg update

Special thanks to Mads Kiilrich for suggesting linux on the mercurial mailing list.

UPDATE: the solution for converting from bazaar on Windows is "...to install Python with the necessary extra modules and either install Mercurial from source or with the Python-specific installers from http://bitbucket.org/tortoisehg/thg-winbuild/downloads/ - for example mercurial-1.6.3.win32-py2.6.exe " (source)

matt wilkie
Matt: I've make a patch for convert that will make it update the converted repository by default. You can add a comment here if you like: http://mercurial.markmail.org/thread/ab3o4lwxxwmzkfni
Martin Geisler
cool, thanks Martin.
matt wilkie