Question

I am using Mercurial to develop a client project. After I've been working on this for 2 weeks, the client has now requested that I keep all code in their SVN repo.

I want to continue to use Mercurial for development, but to keep the client happy, export all commits (w/ messages) into SVN as well.

Is this possible?

Was it helpful?

Solution

You can use Mercurial as client to their subversion repository.

Have you checked out hgsubversion yet? This allows you to have complete history in Mercurial.

See the details at : https://www.mercurial-scm.org/wiki/WorkingWithSubversion

It provides three ways of working with Subversion. Make sure that you use one and do not mix them.

  1. With hgsubversion
  2. With MQ
  3. Convert extension

[Personal Experience]

I have found hgsubversion better how ever it may have issues while converting the suversion repo to a Mercurial repo.

# This usually fails for a svn repo with 
# large history or large files in revchanges

hg clone svn+http://.../svn local-hg

# If the above has any issues and dies before converting the repo, use hg pull
hg pull

Issue: You have an existing repo already.

  1. I guess the best way would be to create another Mercurial repo from the subversion repo using one of the methods above.
  2. Pull your change sets into this new repo from the older one to get all the changes and history from the previous one
  3. Now you are ready to submit the changes to svn repository
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top