22

The online documentation for hgsubversion sucks, IMO (I hate to say that). I've been following the instructions in the Quick Start.

What have I done?

  1. I installed Mercurial:

    D:\repos\experimental>hg --version Mercurial Distributed SCM (version 1.6)

  2. I installed TortoiseHg to match the Mercurial version.

  3. I downloaded the hgsubversion repository:

    D:\devapps> hg clone http://bitbucket.org/durin42/hgsubversion

  4. I modified my .hgrc as follows:

    [extensions] hgsubversion=D:\devapps\hgsubversion\hgsubversion

    D:\repos\experimental>hg help hgsubversion hgsubversion extension - integration with Subversion repositories

    hgsubversion is an extension for Mercurial that allows it to act as a Subversion client, offering fast, incremental and bidirectional synchronisation.

  5. I installed PySVN for Python 2.5.

  6. I tried to clone an SVN repository:

    ...> hg clone http://path/to/repository/ repository-hg

And I got the following result:

...
abort: Subversion 1.5.0 or later required, but no bindings were found!

WTF? There's nothing in the instructions I'm following that tells you how to install this. Any help is greatly appreciated!! (I just want a way to work without SVN as much as possible - PLEASE HELP!).

les2
  • 14,093
  • 16
  • 59
  • 76
  • 1
    well, i'm done with this sh!t ... when it doesn't require being a python guru to use, maybe i'll give it a shot ... but for now, i'm going to find another way to hack my *java* sources other than by debugging obscure python problems ... -- a bitter man – les2 Jul 23 '10 at 20:49
  • Voting up. I wasted too many days on this as well. I think you have to compile the SWIG bindings FROM SOURCE! It's stuff like this that keeps me away from *nix. :( – leoger Jul 24 '10 at 00:38
  • i figured out a way to get this working without compiling from source ... see the answer I posted ... basically remove the regular Mercurial install from the PATH and leave only TortoiseHg ... – les2 Jul 27 '10 at 18:16
  • 1
    Yes, as the Quick Start says, the bindings are bundled with TortoiseHg so you're all set after installing that and cloning the repository. See also http://tortoisehg.bitbucket.org/manual/1.1/nonhg.html#hgsubversion-svn which again explains that you only need to clone the hgsubversion repository. – Martin Geisler Aug 12 '10 at 11:16
  • 1
    In case anyone has the same problem as me: Since THG 3.4 the subversion bindings are no longer bundled. They have to be downloaded and installed separately. See: https://bitbucket.org/tortoisehg/thg/wiki/libsvn – Uwe Raabe Jan 30 '16 at 13:19

5 Answers5

13

As described in my blog post, you need to do the following to get this working:

  • Remove the /path/to/Mercurial from your PATH variable
  • leave only /path/to/TortoiseHg on the PATH

Now the TortoiseHg binary will be used when you invoke 'hg' from the command line and the hgsubversion extension will work as advertised!

I hope this helps someone!

les2
  • 14,093
  • 16
  • 59
  • 76
  • Actually I was about to suggest you did that, as installing both Mercurial and TortoiseHg is redundant, as the latter packages the former. Anyway, +1, and glad you found the way out. And thanks for your blog post, too. – s.m. Jul 27 '10 at 19:13
  • 5
    TortoiseHg no longer includes bindings. -- https://bitbucket.org/tortoisehg/thg/wiki/libsvn – Mike C Feb 03 '16 at 19:01
  • 1
    Blog link is dead – DCShannon Aug 25 '16 at 19:25
  • Today the problem is most likely to simply come from the fact TortoiseHg no longer includes bindings, and the best is to install them from the page above, rather than using this procedure. – jmd Oct 21 '16 at 11:27
3

I don't actually know much about Windows, but my understanding is that TortoiseHG should bundle everything you need. They have some instructions that it looks like you already followed, but maybe you can ask on their mailing list for some help? They're pretty much the best ones to follow up with.

The SWIG bindings are currently required, but we're close to having support for some other bindings (not PySVN, subvertpy) that should be less hard to install. I can't make any solid claims about how easy/hard those will be on Windows since I have no way of testing that.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
durin42
  • 1,447
  • 8
  • 10
3

After digging same problem, I've found a good instruction on bitbucket, which was a solution for correct installing of python bindings. https://bitbucket.org/tortoisehg/thg/wiki/libsvn

AdvanTiSS
  • 336
  • 3
  • 8
2

I had the exact same problem and just gave up. The major problem is that there are no precompiled win32 Python SWIG bindings for recent versions of SVN.

You may want to see if the hgsvn tools will do what you need: https://www.mercurial-scm.org/wiki/WorkingWithSubversion#With_hgsvn

It's not a proper extenstion, just a bundle of three tools: hgimportsvn, hgpullsvn, and hgpushsvn

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
leoger
  • 1,074
  • 10
  • 16
1

Looks like Python can't find the Subversion bindings.

If you can, try to install TortoiseHg, which bundles them. Maybe because I had it installed, I had no problems at all using hgsubversion.

s.m.
  • 7,895
  • 2
  • 38
  • 46
  • Hmm... what happens if you fire up python's interactive interpreter and try to "from svn import client"? You are seeing this error because "from svn import *something*" does not succeed in hgsubversion code, as it seems from this http://bitbucket.org/durin42/hgsubversion/src/aafbf0d40dc2/hgsubversion/svnwrap/svn_swig_wrapper.py#cl-27 – s.m. Jul 23 '10 at 19:38
  • D:\repos\experimental>python Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import from svn client File "", line 1 import from svn client ^ SyntaxError: invalid syntax >>> from svn import client >>> – les2 Jul 23 '10 at 20:13
  • seemed to work ... >>> from svn import client >>> from svn import core >>> core.SVN_VER_MAJOR 1 >>> core.SVN_VER_MINOR 5 >>> core.SVN_VER_MICRO 3 >>> – les2 Jul 23 '10 at 20:15
  • i have both 2.5 and 3.x of python installed ... currently uninstalling the latter in case that is causing conflicts :) – les2 Jul 23 '10 at 20:18
  • Yes, that *might* be the cause. Sadly I'm no python expert :( – s.m. Jul 23 '10 at 20:35
  • What's the output of "svn --version --quiet"? – s.m. Jul 24 '10 at 09:50
  • TortoiseHg no longer includes SVN bindings. – Mike C Feb 03 '16 at 18:52