Archive for February 27th, 2008

Mercurial and merging branches

I’ve been reading the Hg book today and have found that merging between branches is a much different operation than with CVS or Subversion and much easier. I’m really glad to see this and want to take an even better look at Mercurial by using it a bit. Maybe thats why Tor didn’t talk about it at all in the Posse podcast…there really isn’t much to it ;)

Java Posse on SVN and Mercurial

So the guys were discussing version control systems and Joe was talking about SVN. Tor was talking about Mercurial. The only thing they were talking about was stuff that, quite frankly, really doesn’t matter all that much because any revision control system is going to allow check-ins, etc. Obviously thats the point ;) Joe wonders how dangerous is it to use Mercurial since you’re not checking in to a central repository. You might lose something! Joe…just a note that the same thing is true of SVN if you don’t bother checking in your code ;)
But all this really doesn’t get to what I think is the most important point: what is the merge model like in Mercurial? In SVN when you are merging changes from branch to branch (and in branches I’m including trunk) you have to be really careful with making sure you’re getting the revision numbers right. This is no better than CVS. Sure SVN does most things better than CVS but in this important case it does nothing to make the process better.

I have yet to read about how merging happens in Mercurial. I wonder if you have to track revision numbers as in SVN.

At work we’re looking at Accurev which has a pretty smart model for merging changes. Obviously any merge is going to require some careful checking when you have multiple changes from multiple people to the same area of code but Accurev makes the rest of the process much easier. They use the idea of streams, which are sort of a combination of an SVN branch with workflow attached, and when you merge code you are promoting it to streams higher in the hierarchy. You still have to worry about overlapping code areas, no way around that, but you don’t have to worry about tracking revision numbers.

Now if we could finally get off of CVS…. ;)