Mercurial for the win

In the last couple of days I somehow got turned towards Mercurial as a Versioning system, and after a pretty in depth look decided that it would be the better of the versioning system. At least significantly better than Subversion at any rate not sure about the other versioning systems but I decided to go with this one in particular. Some of the things that I gathered that make it better than Subversion is that it is a distributed system and the way these particular ones work is that the whole repository is cloned instead of a revision being checked out. This is nice as there will always be a backup of the main repository so long as a developer has a clone that is fairly up to date. Now it does add additional steps when committing as you commit to your local repo then push the changes to the main host. Another thing mercurial does that is really interesting is that it has a built-in web server that will show the local repo and and even allow others to clone directly off your machine. Which means setup is really quite trivial, There are some detailed instructions on their main site for setting it up with apache, and using ssh to have read/write access is nice. However on the mac there are a few things that I have noticed. One when using hg commit and either vi or nano it won't commit and I haven't quite figured that one out something to do with the file being edited but not a huge deal. There is a mechanism to commit with a message from the command line so it works out well enough for me. There is a mac gui client for mercurial called macmecurial which doesn't seem too bad but is rather quite confusing and the author of it never setup any real support/documentation mechanisms to help setup and run the program other than what is in the help file which isn't that detailed. Macmercurial would probably be easier for me to use now that I am more comfortable with the command line methods anyways and spent some time configuring them. Also setting up a gui text editor as the general editor for commits and such doesn't work very well especially using the open -a command as it forks the gui program and exits then hg commit fails because the file was never edited.

All relative in the end for me, subversion didn't really have that solid of an open source client for the mac anyways and Mercurial offers too much added things to not look at it carefully. The configuration files were not too horrible, the wiki wasn't exactly the greatest at explaining how they work. Here is the one I made at ~/.hgrc

[ui]
username = Daniel Myers <email>
editor = nano

[merge-tools]
kdiff3.args = $base $local $other -o $output
kdiff3.executable = /Applications/kdiff3.app/Contents/MacOS/kdiff3
kdiff3.priority = 100

Not sure if the kdiff3 stuff was absolutely needed but I had read somewhere that the path part was at least, I just went ahead and added the other pieces to make it easier and to make sure that it worked. Username is what you want the commits to be logged as and editor is preferred editor, now like I said earlier don't use open -a texteditor or textwrangler here as they fork and exit and it causes problems anyways.

To create a new clone on your computer from an existing repo it is pretty simply go hg clone serveraddress dest dir and your all set. In fact when you do that it also creates a hgrc file in that dest dir that records the default path as the remote server so when time comes to push the changes up to the main repo you just have to do a hg push.
Most of the information for mercurial can be found here: http://www.selenic.com/mercurial/wiki/