21

A similar question has been asked recently, but is not the same.

The Mercurial website has a detailed page listing comparisons for 4 different options for getting Mercurial and Subversion to interoperate.

I am wondering if anyone out there has tried one or more of these, and could relate any really good or really bad experiences. The note on the hgsubversion download says

hgsubversion is an extension for Mercurial that allows using Mercurial as a Subversion client. Right now it is not ready for production use. You should only be using this if you're ready to hack on it, and go diving into the internals of Mercurial and/or Subversion.

which is about as inviting to me signs that say "Abandon hope, all ye who enter here" or "Trespassers will be arrested". So I'm just wondering if this or any of the other alternatives are worth trying for someone who doesn't have a lot of extra time to hack around.

Community
  • 1
  • 1
Jason S
  • 184,598
  • 164
  • 608
  • 970
  • 4
    +1 for laziness. With all the warnings, I couldn't bring myself to try any of the options either :-) – Wim Coenen May 05 '09 at 22:16
  • I wouldn't call it "lazy", I'd call it being "thrifty". Setting up / managing a source control configuration is (supposed to be) only a small portion of software work which in turn is only a small part of my job. Either that or I have to go pester our IT group and they aren't going to know since they usually work with "Real" software (Windows/IIS/SQLServer etc). So I have to use my time wisely when it comes to "small" tasks like this. When I'm lazy for real, I take pride in it. :) – Jason S May 05 '09 at 22:36
  • "now it is not ready for production use" - is this still the case? – inger Jul 27 '10 at 14:46
  • TortoiseHG users can refer to http://abdullin.com/journal/2010/3/22/use-tortoisehg-mercurial-with-svn-repository.html. Works well albeit a bit slow – Ahmad Dec 15 '10 at 18:16

6 Answers6

4

I think hgsubversions author is being a bit paranoid. If you follow the README - meaning use suitably recent versions of mercurial and subversion - not whatever happens to be installed on or by your distro - then it actually works fairly well. Likewise, the documentation included is up to date; whereas what you find on the web may not be. I've been using it for a couple of weeks with reasonable - but not perfect - results.

It's when you get into the corners of the two systems that you have problems: hgsubversion and other extensions (I have problems with hgtasks) don't seem to like each other; it's not clear how properties are handled, etc.

  • Hello from the future! I've been using hgsubversion for a couple of months of daily use at work, and it seems mostly fine. It has some awkwardnesses compared to pure Mercurial (eg not being able to update from Svn when i have uncommitted changes), and it has screwed up really badly when trying to rebase over a weird branching event in Svn (so don't do that), but other than that, no problem. – Tom Anderson Mar 09 '12 at 11:22
3

I've just started working with option 4, hgsvn. Despite what the Mercurial page says, hgsvn 0.1.7 does support pushing back to the svn repo.

My use case is very simple: I really only want the ability to have local branches (at this stage). The workflow listed on the hgsvn page is exactly what I've used and so far it hasn't broken anything.

3

I'd like to second option hgsvn, it's rather slow if you want to mirror a big repository, but you can start at revision close to the tip (which is usually what you want anyway).

I found it very robust, mirrored repositories with over 5000 revisions. You can push changesets back if that's what you want.

wires
  • 4,718
  • 2
  • 35
  • 31
  • Let me add a tip: I currently use mercurial + hgsvn + http://arrenbrecht.ch/mercurial/pbranch/ to contribute to (open source) projects. Just pull the svn repo into mercurial manage your patches using pbranch. You then communicate your patches via email to the project maintainers. – wires Jun 04 '10 at 11:53
2

Yeah, you must use a recent "crew version" of Mercurial, see the CrewRepository page on the Mercurial wiki.

When Mercurial 1.3 is released on July 1st, hgsubversion should begin maintaining a stable branch. At least that's the word on IRC (#hgsubversion on irc.freenode.net).

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
  • ooh ahh. I look fwd to Jul 1 then. – Jason S May 21 '09 at 15:52
  • dohhwww, it looks like this is not true for hgsubversion; the "convert" extension is the thing that apparently got added/released – Jason S Aug 10 '09 at 20:12
  • The convert extension is the one that is shipped with Mercurial (and has been shipped for a long time). I'm sorry that hgsubversion has not yet released a stable version, apparently they got into a bigger rewrite than they thought at the time I answered this question. – Martin Geisler Aug 16 '09 at 09:33
1

I've been using Subversion for several years, but I'm interested in trying out this distributed VCS idea. (I would like to use git, but it isn't so good on Windows which rules it out for use at my work. So I next would like to try Mercurial.)

I initially would like to push and pull with a Subversion server. So I tried option 1, hgsubversion. I'm on Ubuntu 9.04 (Jaunty) with hg 1.1.2. I followed the directions given on that web page. It all seemed to install fine. But when I tried the hg svnclone command, I got an "unknown command" error. Further digging showed that now you just do hg clone with the SVN URL prefixed by svn+. e.g.:

hg clone svn+https://server/svn/repo/

But then, I got an error message:

abort: could not import module encoding!

That seems to be a known bug, but after some fiddling around, I couldn't figure out what I'm meant to do to fix it.

Summary: option 1 currently not functional for me. The other options don't fit my desired work-flow.

Update: I tried it again with Mercurial 1.2.1, and got the same result. Someone told me that the in-development mercurial-crew branch should work.

Craig McQueen
  • 41,871
  • 30
  • 130
  • 181
  • 1
    you need the latest versions of mercurial and hgsubversion. However - be careful with hgsubversion at the moment. It looks like there is a lot of refactoring going on – Nick Randell Jun 03 '09 at 16:17
  • Yeah, you need Mercurial 1.3 -- the encoding module was added after 1.2.1 was released. – Martin Geisler Jul 12 '09 at 11:35
0

I have been using hgsubversion for several months. You might be missing some features but it is ready for production use.

OGRE and many others have decided to use hgsubversion because it is fast.

Afriza N. Arief
  • 7,696
  • 5
  • 47
  • 74