Switching to Mercurial

So I’m trying out Mercurial.

The reason is that it is now integrated into FogBugz through Kiln – a new FogCreek Software as a Service software offering, which seems pretty amazing.

The first Mercurial resource I found particularly helpful was Martin Geisler’s article here:  http://mercurial.selenic.com/quickstart/.  This is a very short article that outlines the basics in “6 steps”.

The other resource that was really helpful was Joel Spolsky’s excellent Mercurial tutorial here:  http://hginit.com/.  As usual, Joel’s writing style is funny and informative.  His “Subversion Re-education” is particularly enlightening, and I completely agree with his statement that:

…here’s how Subversion works:  When you check new code in, everybody else gets it.

[So] Subversion team members often go days or weeks without checking anything in. In Subversion teams, newbies are terrified of checking any code in, for fear of breaking the build…

I have two machines, and I program on both simultaneously.  (It takes about 3 minutes to build the application and run all the unit tests, so I will switch over to the other computer and program on it while I’m waiting for the unit test results.)

Even with only two computers and one programmer this “feature” of Subversion has been really affecting and frustrating me lately.  I really want a source code repository where I can check-in temporary code to help “snapshot” it, even if it is not completely ready for the main “trunk”.  Subversion doesn’t  have that without using branches (which are scary in Subversion) – but Mercurial (and any DVCS) does provide this wonderful feature and it’s not scary at all.

Both of these articles have helped changed the way I think about version control, or at least helped to start changing my thinking.

The good folks at FogCreek have also been kind enough to answer a few questions, and the http://Kiln.StackExchange.com website is full of Mercurial questions and answers as well.  My first question was asking about how to handle large projects and shared utility libraries:


TortoiseHg now works wonderfully on Vista x64 – it didn’t when I first looked at Mercurial.  It’s not quite as “pretty” as TortoiseSVN visually, but it gets the job done and seems more functional.

I have found two plug-ins for Visual Studio 2008 and 2010:

I installed the HgSccPackage, because StackExchange had good things to say about it, and it seems to do the trick nicely.  When I add a new class in VS2010 it automatically adds it to the Mercurial repository, just like you’d expect. So far, so good!



4 comments so far

  1. David Allen on

    Thanks for the tip.

    I use TFS at work. I had no source control at home. I just now tried Mercurial, Tortoise, and HgSccPackage, integrated with my Visual Studio 2010 RC and it all works great. This is my first real effort at SCC other than TFS. So I have a bit to learn about the Mercurial approach to the repository.

    I am running Windows 7 64-bit. And I bought Beyond Compare for file comparisons.

  2. robertmccarter on

    Cool – how do you find Beyond Compare?

  3. David Allen on

    I originally bought it years ago to compare folders in a production environment against folders in a reference environment when things were not acting as expected.
    At my current employer we have strong discipline and skills around cloning, refreshing and managing environments. So we see those problems much less.

    Now, as I was getting ready to say it works fine as a Visual Studio add-on I have to pause. I just installed several things today. And my visual studio is crashing very badly. I installed Resharper beta 5, Code Contracts. I had already installed Mercurial and Tortoise adn the HgSccPackage. That’s a lot to diagnose. So I will uninstall them one at a time in what I hope is the order I added them and try to figure out the worst culprit. It was fine yesterday. Oh well. That is the hazard of adding serveral beta add ons to a release candidate 🙂

  4. robertmccarter on

    I would be very interested to know what you discover!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: