oscarmlage oscarmlage

Using mercurial a la darcs

Written by oscarmlage on

Nowadays using a version control system is as basic as using an editor. I have to admit I'm a mercurial fanboy because it's clear, simple and written in python.

In some other projects we're using darcs, similar to mercurial but with a different approach. As we've organized the darcs project, we must pull, create a patch with the new features, and send it to our QA department for review and bug hunting. If there are errors we must fix them and rewrite + resend the patch for a new review. Once the code is ok, the SYS department pushes the patch to staging (if there are more tests to be done) and finally to production enviroment.

The mercurial flow, ordinarily, is something like pull, write new features (or fix bugs), commit or record and push. We can have different repos like repo-devel, repo-staging and repo-production and play testing new features and pushing stuff between repos and enviroments. But what if we want to work with patches in a similar way that the one I've mentioned above?. Easy peasy.

I would have never noticed, but this is one of the advantages to work with smart people as Borja, the flow in this case should be... pull, write new features (or fix bugs), create a patch with hg diff > new_feature.patch and send it to review. The reviewer will apply with patch -p1 < new_feature.patch and he/she can edit, commit, record or revert. So easy too!.

Note that I'm not used to Mercurial Queues Extension, probably a better way to proceed in this case.