I've found what appear to be very similar questions here on SO, with what appear to be good answers; but for some reason, I still can't seem to figure out how to get this to work. My concern is that it may simply not be possible.
Here's the situation: I am working on a small team that uses a central SVN repository as our version control system. My pair programmer and I got frustrated not having the option of local commits (and didn't want to have to go through the hassle of using SVN branches), so we looked into using either Git or Mercurial as an SVN client and found that hgsubversion seems capable of doing what we want: to work locally on an Hg repository, commit locally, and only push to SVN when we're ready.
When the time came to push, we received this error message from Hg:
Sorry, can't find svn parent of a merge revision.
I'm wondering if the problem is that we had to pull changes from SVN to get our teammates' updates, then merge with our local changes, and now Hg can't figure out how to make SVN happy? This seems to be the message I'm getting from the other SO questions & answers I've looked at; however, the advice that was dispensed in those cases (doing hg rebase --svn
) seems not to work for us either; that same "can't find svn parent" message is given.
Is this even possible? Or is it more trouble than it's worth when other developers on the team are making changes directly to SVN?
This retrieves all the changes from the SVN repository and applies them on top of your local commits in your current branch. This works like, you know, a rebase between two branches :) You can also use git svn fetch to retrieve the changes from the SVN repository but without applying them to your local branch.
No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.
I've been doing this for over a year now and it works great. I get sweet, sweet DVCS love and the rest of the folks, uh... don't. I use hgsubversion as my bridge. I had quite a bit of trouble with hg-svn. YMMV.
I used this to get setup and have been loving it ever since!
The caveat is, you can't use Mercurial to merge changes between branches. You can still work on the branch (use hg up [some-branch]
), but when it comes time to merge it into trunk, you'll need to commit, push to some-branch
, then use subversion to merge some-branch
into trunk.
I've prepared a blog post that describes this procedure in detail. You can see it here: http://xinmyname.tumblr.com/post/11305033055/subversion-mercurial-branches-oh-my
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With