Thursday, December 6, 2007

The Darkside is Here

For most of my projects I'm using the distributed revision control system darcs. I particularly like how easy and streamlined it is. Creating repositories, branches or pushing single patches around is just a matter of a few minutes in learning time. Another nice feature is, that you can commit only parts of the changes in a single file; darcs will just ask you about each change. Choosing the changes one wants to record on the command line can be a tedious process though. This is why I wrote us an internal tool called "Darkside" which allows us to easily pick all changes using a straightforward dialog. The following screenshot shows the "Patch Recorder" tool of Darkside. An editor pane below the change-tree shows which lines were removed (red) and which were added (green). Darkside is written in LispWorks using CAPI.

The next screenshot shows the second tab-pane of the interface. Here one can write the log-message for the current record. I extended darcs' notion of a patch name a little bit by providing a combo-box with certain tags like "Feature", "Change", "Bugfix" and so on. The selected tag gets enclosed in brackets and then prepended before the patch-name. This is actually just a convention we developed using darcs. The list-pane below the log-editor shows other patches which have been recorded before. It is possible to double-click those lines to paste the log-text of this patch into the log-editor.

CL-Darcs: A Common Lisp Implementation

The original darcs (which is used in Darkside too) is written in Haskell, a statically typed functional programming language. The installation is simple: just copy the executable somewhere into your path. Wouldn't it be nice to have an implementation of darcs in common lisp? Well, we have luck! Thanks to Magnus Henoch's cl-darcs there is already a common lisp library which aims to be compatible with the original darcs implementation. The code is nicely structured and good readable. One really missing thing for a cl-darcs to ensure compatibility to the original darcs is an extensive test-suite. But Magnus implements the command-line interface of darcs on top of the common lisp API so that one can use the official darcs test suite. I think cl-darcs is a very promising project.