views:

328

answers:

4

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!).

+2  A: 

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.

sm
I do have TortoiseHg installed ...
LES2
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
sm
D:\repos\experimental>pythonPython 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import from svn client File "<stdin>", line 1 import from svn client ^SyntaxError: invalid syntax>>> from svn import client>>>
LES2
seemed to work ...>>> from svn import client>>> from svn import core>>> core.SVN_VER_MAJOR1>>> core.SVN_VER_MINOR5>>> core.SVN_VER_MICRO3>>>
LES2
i have both 2.5 and 3.x of python installed ... currently uninstalling the latter in case that is causing conflicts :)
LES2
Yes, that *might* be the cause. Sadly I'm no python expert :(
sm
sadly, didn't work :(
LES2
What's the output of "svn --version --quiet"?
sm
+2  A: 

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: http://mercurial.selenic.com/wiki/WorkingWithSubversion#With_hgsvn

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

leo grrr
+2  A: 

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 [0], but maybe you can ask on their mailing list [1] 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.

[0] http://tortoisehg.bitbucket.org/manual/1.0/nonhg.html#hgsubversion-svn

[1] https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

durin42
+4  A: 

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
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.
sm