I have a small project which I started in bazaar, as an exercise to learn bzr. I've since decided I prefer Mercurial. How might I migrate this project to Hg?
2 Answers
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

- 8,084
- 8
- 48
- 62

- 281
- 1
- 2
-
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 Sep 07 '10 at 23:52
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)

- 8,084
- 8
- 48
- 62

- 17,268
- 24
- 80
- 115
-
1Matt: 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 Sep 10 '10 at 12:34