RE: Why Subversion does not suck

Thursday, December 11, 2008

(This is a response to Andy Singleton’s ”Why Subversion does not suck” blog post.)

The problem I have with this line of reasoning is that it assumes that DVCS must be more complicated than its centralized sibling.

This is just not true.

Let’s compare and contrast workflow of Subversion and Mercurial (which I know better than Git). We’ll even assume that a repository has already been created for you.

Setting up your local copy of the repository? svn checkout _url_ or hg clone _url_.

Updating? svn update or hg pull.

Committing work? svn commit (unless you’re off-line, then you just stop) or hg commit; hg push (unless you’re off-line, then you wait and batch your commits).

Changes to the filesystem? svn {add,delete,copy,move} == hg {add,remove,copy,rename}.

Want to see what has changed? {svn,hg} {status,diff}.

Ok, let’s get complicated. You want to set up a new repository for your company.

Subversion:

$ svnadmin create /usr/local/svn/newrepos
$ svn import mytree file:///usr/local/svn/newrepos/some/project

This is straight out of the docs, by the way. While you’re doing that, read over Chapter 5. Repository Administration and Chapter 6. Server Configuration to make sure you can keep it working.

The same with Mercurial? Get into the code directory you want to work with, and:

$ hg init && hg addremove

This will put all these files in the repository, so you could instead hg add those you’re interested in, but the former command would be Subversion’s create/import pair. Share with ssh, or put it on a shared directory, or whatever. You can even get the nice http interface by running hg serve (a good way to start, and you can ramp up later if you want).

Oh, and if it’s the graphical interface you want, Tortoise makes the same thing for Mercurial, as well: TortoiseHG (See also the Other Tools page for even more cool GUIs.)

As I said, I’m more familiar with Mercurial, so I’m not sure if all this holds for Git, but from what I’ve heard, it does. What about documentation? The Mercurial book is just as good as the Subversion one, IMHO.

tldr? Mercurial is as simple to learn (if not simpler) than Subversion, and is easier to play around with (hg init > svnadmin create).

blog comments powered by Disqus