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 开发者_JS百科project to Hg?
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
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)
精彩评论