interoperation between mercurial and subversion

2019-02-03 05:20发布

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.

6条回答
我想做一个坏孩纸
2楼-- · 2019-02-03 05:28

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.

查看更多
在下西门庆
3楼-- · 2019-02-03 05:31

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

查看更多
狗以群分
4楼-- · 2019-02-03 05:33

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.

查看更多
一夜七次
5楼-- · 2019-02-03 05:44

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.

查看更多
老娘就宠你
6楼-- · 2019-02-03 05:46

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.

查看更多
相关推荐>>
7楼-- · 2019-02-03 05:53

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.

查看更多
登录 后发表回答