Who likes mercurial? I do. Lately, I even started using mercurial as a client for subversion repositories. Let me describe the hgsubversion installation steps that worked for me; on my laptop that is boldly supplied with The Only Right operation system…
I heavily borrow from excellent entry by Ben Collins-Sussman and from outrageously diligent post by Dave Cameron. I want to focus on the smallest possible installation routine on windows. Also, I want to emphasize that you don’t have to build anything on windows. All the prepackaged installables or binaries are ready, waiting for you to grab them.
Oh right, here are the steps that worked for me:
- Install mercurial (TortoiseHg)
- Clone hgsubversion
- Configure hgsubversion extension
- Start cloning svn repos!
- Understand the gotchas
- Stay happy
1. Install mercurial (TortoiseHg). I installed TortoiseHg (mercurial + tortoise). Your cmd should nicely take: hg version.
In theory you can install different Mercurial client. However, there is a huge advantage of installing TortoiseHg: you don’t have to install python, svn python bindings & make your Mercurial use it. All because TortoiseHg comes with python+svn bindings (thanks Afriza for a hint!).
2. Clone hgsubversion:
hg clone http://bitbucket.org/durin42/hgsubversion SomeFantasticFolder
In my case SomeFantasticFolder is c:\projects\open-source\hgsubversion. At the moment I cloned hgsubversion the tip was the changeset 500.
3. Configure hgsubversion extension. Add extensions to your USER_HOME/.hgrc, which on windows is Documents and Settings\SomeFabulousName. In my case SomeFabulousName is sg0897xxx (after years in IT industry I’m still just a number…). Note that hgsubversion is duplicated at the end – that’s fine. Your .hgrc should contain something like:
[extensions]
rebase=
#do not quote the path if it has spaces!
svn=c:\projects\open-source\hgsubversion\hgsubversion
Your cmd should print enabled extensions at the bottom of the screen when you do: hg help extensions
4. Start cloning svn repos!
Instead of cloning repos with “hg clone” I suggest to “hg pull” instead. Pull is better because it can continue in case something breaks (cloning very large repo can takes hours).
hg init example
cd example
hg pull http://example-for-hgsubversion.googlecode.com/svn example-for-hgsubversion
5. Understand the gotchas.
6. Stay happy. Are you kidding me? You know what to do =)