Showing posts with label Mercurial. Show all posts
Showing posts with label Mercurial. Show all posts

20 June 2009

Mercurial and moving of files.

A problem, when you're using Mercurial forversioning is, that Mercurial only knows about files and there paths. This results in two types of trouble.
First you cannot commit an empty directory. It will be just ignored. To solve his, create a hidden empty file (one with a dot at the beginning of the name like '.hidden') and commit it.
Second you cannot just rename, or move a file. Mercurial will think, that there is a new file and the old one isn't available anymore and that fact crashes your commit. To solve this, Mercurial provides the command 'mv' (like the UNIX command). Just type
hg mv path/to/my/SourceFile path/to/my/DestFile
into your Terminal and you're moving or renaming it. Mercurial will then understand, that both files are the same.

Git vs Mercurial and the fight of SCMs

In the past I was using Subversion as a SCM (Source Control Managment) and Google's project hosting is still using it, so Google Code was allways a good place for hosting some open source code.
But now the world has changed. I recognized the idea of distributed SCM (DSCM) first, when I heard about github.com and I gave it try. The big benefits are, that you can work offline and everyone has his own repository with full versioning and so on. The result for my own work is, that I do much more commits and of cause smaller ones. Just after doing a cupple of them, I push my changes to the server.

But What is the right system and right hoster?


This is a very interesting question and it forced me to test a little bit around. And I found a cupple of benefits on each system and each hoster. But in the end I decided to stay on Google Code and use Mercurial.
The reasons are pretty simple:
  • Mercurial isn't that different from Git as I expected.
  • Social comopents are not so interesting for a project hosting.
  • Google has a much better code and history browsing than github.
  • Extisting Subversion projects can be converted including history.
So my desicision was clear. I mooved the DuckWiki repo to Google Code, and will use Google Code and Mercurial in the future.

If you're thinking about Mercurial and Git, there is another point, you might be interested in, which I didn't care about so much:
While Git only works over SSH, Mercurial provides you the choice between SSH (makes maybe more sence in a Company's internal network) and HTTP (is much nicer, if you're repo should be open for annonymous users).