views:

1738

answers:

3

This is a but of a part 2 in trying to convert an SVN repository to a Mercurial one

command is:

hg convert file://c:/svnrepository

but, the output I get is:

assuming destination svnrepository-hg
initializing destination svnrepository-hg repository
file://c:/svnrepository does not look like a CVS checkout
file://c:/svnrepository does not look like a Git repo
Subversion python bindings could not be loaded
file://c:/svnrepository is not a local Mercurial repo
file://c:/svnrepository does not look like a darcs repo
file://c:/svnrepository does not look like a monotone repo
file://c:/svnrepository does not look like a GNU Arch repo
file://c:/svnrepository does not look like a Bazaar repo
file://c:/svnrepository does not look like a P4 repo
abort: file://c:/svnrepository: missing or unsupported repository

The line I'm interested in is:

Subversion python bindings could not be loaded

I have installed python 2.5, and I have installed the python subversion bindings from the subversion website. But still getting this error

+9  A: 

The problem's explained here at heading "Converting from Subversion":

Subversion's Python bindings are a prerequisite. The bindings (generated with SWIG) are installed separately on Windows, and can be found on http://subversion.tigris.org/ . Note that you can't do this with the Win32 Mercurial binaries -- there's no way to install the Subversion bindings into its built-in Python library. So you'll need to use a Mercurial installed on top of a stand-alone Python, and you may also need to do something like "set HG=python c:\Python25\Scripts\hg" to override the default Win32 binaries if you have those installed also. For Mac OS X, the easiest way is to install the CollabNet Subversion build, and then copy the content of /opt/subversion/lib/svn-python to the site-package directory of the python installation.

Unfortunately hg + svn + win doesn't apparently get any easier with hgsubversion, at least judging from this post and this discussion thereof (I have no Windows installed to try and help out, sigh).

Alex Martelli
Oh man that's complicated. They don't make this easy do they! I don't even know what "build Mercurial on top of Python" means - I installed them both.
Paul
According to: http://www.selenic.com/pipermail/mercurial/2009-May/026015.html the subversion bindings are included in tortoisehg. So you just need to enable the convert extension in tortoisehg.
tonfa
Ah ha! Another step forward. I changed my path to point at hg in TortoiseHG instead of Mercurial and this got over that hurdle. Now it just doesn't think the repository is an SVN one, ahh!
Paul
Woo! We have lift off. Would you believe, this doesn't work: "hg convert file://c:/svnrepository" but this does "hg convert file://C:/svnrepository"
Paul
@IP, thanks for the updates -- it's truly amazing that the case (upper vs lower) of the path would make such a difference, but the great thing is that you managed to find that out!!!
Alex Martelli
@IP I believe the correct format is "hg convert file:///C:/svnrepository". Note it is 3 forward slashes after file:
Tim Murphy
+2  A: 
sudo apt-get install python-subversion

did the trik for me on ubuntu..

ashishsony
+4  A: 

I just wanted to bring the actual solution out of the comments to Alex Martelli's answer:

According to: selenic.com/pipermail/mercurial/2009-May/… the subversion bindings are included in tortoisehg. So you just need to enable the convert extension in tortoisehg. – tonfa

Ah ha! Another step forward. I changed my path to point at hg in TortoiseHG instead of Mercurial and this got over that hurdle. Now it just doesn't think the repository is an SVN one, ahh! – Paul

This worked for me as well.

If you're currently using the standard command line version of HG on Windows, the specific steps are:

  • Install TortoiseHG
  • Right click a file / TortoiseHG / Global Settings... / Extensions / {Check "convert"}
  • Make sure TortoiseHG is the path for your hg command:
    • WinKey+Pause / Advanced / Environment Variables / System Variables / Path
    • REMOVE C:\Program Files\Mercurial from the path
    • Make sure C:\Program Files\TortoiseHG is there
Jerph
Another way to achieve this seems to be to use the full path to the hg executable. So in my case this would be "c:\Program Files (x86)\TortoiseHg\hg.exe" convert file:///c:/svn/repo_name
MattFu