Our friend Fabio Maulo published a few days ago about converting Subversion repositories into Mercurial, so in that way we could “rid off” svn repositories and move into Mercurial. Well, I must admit, I love mercurial from first sight, but sometimes you could not afford transform the whole SVN repository, sometimes (probably because you are working on a client’s repository) you need to keep using Subversion as your main development repository but you will like to work with Mercurial as a SVN client (like a lot of people do using Git and Git-Svn).
As many of you remember, one of the biggest mercurial’s strong points is the support for extensions. There are extensions for almost anything, and all of them are written in Python language (an easy and very powerful programming language). There is a project named Hg-Svn, which allows us to use Mercurial as a Subversion client, treating our Subversion repository as a remote Mercurial repository, in that way we could use hg common remote operations (like push, pull, fetch).
Install it in Windows could become cumbersome, mainly because it is only available as Python source code and many Hg users in Windows doesn’t have a python interpreter. I will publish the easiest way to do it in Windows
- Install TortoiseHg (if you don’t have installed already)
- Enable rebase extension in your mercurial.ini (
rebase =) - Fetch Hg-Svn source code from Bitbucket repository (http://bitbucket.org/durin42/hgsubversion) do it into a known directory.
- Modify your mercurial.ini file and add svn as an extension, pointing it to the place you got hgsubversion, for example
svn = d:srchgsvnhgsubversion
- Done!, just test your configuration with hg help extensions and look for svn
Use the extension is really easy, just clone from a subversion repository as you would do from a Mercurial repository.
hg clone svn+http://svn.caffeine-it.com/openrasta/ openrasta
And, of course, you may send your changes as you would do with a remote repo
hg push
If your changes creates a new head into your local hg repository, when you push to Subversion repository it will automatically rebase your head into subversion head, remember, subversion is a linear source control system.
Well, I hope it will help you to get more fun with your mercurial installation
