Search code examples
pythonsvnmercurialmercurial-convert

hg convert, Subversion python bindings error


I'm trying to convert a subversion repository to mercurial a one and at this point I'm just banging my head against the wall.

On the current windows server the following programs are installed:

  • Visual SVN Server,

  • TortoiseHg,

  • Python2.7

In my console I run the command

 hg convert [dest] [source]

Which gives a lot of errors about the repository being of different types and also this

 could not load Subversion python bindings

After some googling I found that those bindings are supposed to be included with TortoiseHg, but as I already mentioned I have TortoiseHg installed and it's still not working. I then tried to download the svn python bindings and read somewhere that I should add them in the Python27/Lib/site-packages directory but it's still not working. I think that I maybe have to recompile those bindings with python or something, but I've never used python so I'm pretty lost


Solution

    1. You used parameters in incorrect order

      hg convert [OPTION]... SOURCE [DEST [REVMAP]]

    2. For TortoiseHG 3.4 and later you must to download and enable Subversion bindings as separate extension

    [extensions]
    ...
    svnbindings = c:\insertpath.py
    
    1. Even if you have Subversion-binding in Mercurial (try and show here output ofhg version --svn), you can't convert 1.8 repositories with file:/// access-protocol, only with any networking
    >hg version --svn
    ...
    hgsubversion: 538bbb927609
    Subversion: 1.7.5
    bindings: SWIG
    
    >hg convert file:///Z:/SVN
    assuming destination SVN-hg
    initializing destination SVN-hg repository
    abort: repository 'file:///Z:/SVN' is not local
    

    Z:\SVN repo was created with plain svnadmin create

    >hg convert file:///Z:/SVN17
    assuming destination SVN17-hg
    initializing destination SVN17-hg repository
    scanning source...
    sorting...
    converting...
    0 Initial data
    

    Z:\SVN17 was created with --compatible-version 1.7 option