Mercurial, and other monsters

Brad Lassey recently vented some understandable frustration with Mercurial, the new distributed version control system we’re using for Mozilla 2 development.

I sympathize with Brad, especially because almost all of the comments seem to be along the lines of “No no, you’re mistaken, Mercurial makes things easier, not harder” or “Well, you should have done X,” without understanding Brad’s problem.

Still, I think Brad’s frustration is somewhat misplaced. The other side of the story involves Windows Vista. Brad did some work in a Mercurial repo on Vista, then zipped up the whole repo and moved it to a Windows XP VM. This is supposed to work just fine. But (and this part, we think, this is due to a brilliant top-secret feature of Windows Vista called virtualization, a feature so awful the mobile developers have resorted to logging in as Administrator all the time) Brad ended up with a zip file that had multiple copies of some files. Whatever Vista put into that zip, extracting it on XP produced a corrupt repository. (Specifically, Mercurial’s working directory was at revision X, but it thought it was at revision Y.)

Mercurial is different in a lot of ways. Compared to CVS, it’s more flexible and more complex. Mercurial vs. CVS reminds me of C++ vs. C:

  • There are a lot of quite different ways to use it.
  • There are some ease-of-use issues.
  • It’s easy to think you understand it, and how to use it, and which features to ignore, and exactly how everyone else should use it, when you really really don’t.
  • Conversations about how to use it are not going to be trivial.
  • Getting started by using Mercurial as “a better CVS” doesn’t deliver a huge win and is a little frustrating, because some things don’t quite translate.
  • Perhaps most importantly, shooting yourself in the foot feels a lot like C++. I’ve done it a few times now—boring stories.

After ten years of ups and downs with C++, I’ve made my peace with it and wouldn’t want to go back to pure C.

Update: It turns out Brad’s problem was at least partly caused by the Mercurial binary distribution he was using. The default hgmerge script was broken in an exciting way. I believe it’s fixed in the latest binary distribution.

7 Responses to Mercurial, and other monsters

  1. Not sure C++ and C is a good comparison here.

    The power of a distributed SCM (like Mercurial or git) isn’t in the commands but how you can work in an isolated and local environment until you are ready to push your changes to a more public location.

    Learning the commands is separate.


  2. Hi, jorendorff -

    I wouldn’t presume to tell Brad or you what you should be doing instead of your current practices, because as far as I know, you haven’t said what those practices are.

    In particular, if you are having problems and you’re not reporting them to the Mercurial developers, then they can’t help.

  3. Nobody could know Brad problem as he didn’t give any clue.

    Now it seems that it was a misconfigured merge tool….

    I had the exact problem, see my “PS:” part on his blog comment….

  4. Why Mercurial and not Git out of interest?

  5. Well, here’s for hoping it won’t take Mozilla 10 years to make peace with Mercurial. ;-)

    (for full disclosure, I haven’t had to touch it for actual development yet)

  6. In reply to comment #1: I really don’t know what that means. You can do that with CVS.

    dougt makes the point that you can even do cloning-like things with CVS: because it’s simple and you’ve used it for years and you understand it, you can hack it (writing shell scripts to copy things around and make patches, for example.) And because you write the hacks yourself, they’re no more complex than your use case demands, and you understand them and are less likely to make mistakes.

    (I kind of disagree with all that, but I can see where he’s coming from.)

    The power of hg is all in cloning. Where with CVS there’s a single central repo, hg gives you an arbitrary graph of repos that you can hook up any way you want.

    The power is in the paradigm shift, and the paradigm shift is tricky and takes time to absorb. Hence my comparison to C vs. C++.

  7. Joseph R. Justice

    Your link in the article to “understandable frustration” should probably be to the permalink for that particular blog post and not to the blog’s front / home page.

    The permalink appears to be .

    Thanks for your time. Hope this is of some use, interest.


    PS: IMO, the little GUI icons beside the fields for posting a comment should have a tooltip or something, and/or a text addition, indicating what each field is supposed to contain. I had to look at the file properties for each graphic and look at the file name to make a guess as to what’s supposed to go where. — J

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>