Skip to content

{ Category Archives } darcs

Darcs is revision control system I use to use before converting to git.

Using Tailor to go to git

As our code repositories for Thousand Parsec where down anyway (because of the host being compromised), we decided to do something we had been thinking about for a while. We converted all our code repositories to git.

We had previously been using darcs, however the unbounded memory usage was getting out of hand. The straw which broke the camel’s back was when nash couldn’t even checkout the web repository because darcs kept getting killed by the Out of Memory Manager (on a machine which has more then 512Mb of RAM).

After much discussion we decided to move to git. The biggest reason we choose to use git was that we didn’t want to get stuck with another non-mainstream SCM system. With large people like Xorg, the Linux Kernel and many others, I’m pretty sure git will become the SCM of choice in the near future.

As I had previously had a large amount of experience converting the darcs repositories to subversion (for our mirrors), I was put in charge of converting the repositories to git. As previously, I used Tailor.

The first problem is that darcs has git repository support. The suppose solution to this is using disjunct working directories. However, git did not appear to like this, I need to hack up the source code to get it to work. I’ve submitted the patches back the Tailor repository and they have already been included!

Another problem I ran into was that I don’t have a machine which has enough memory to convert the web repository! I don’t have a computer with more then 768mb of ram (feel free to send me some more if you want! :P). Luckily thanks to the Summer of Code, a student who goes by the name cherez (who I was very disappointed we didn’t have enough slots to select) gave me a shell account on his machine with 4Gb of Ram.

As a result of converting to git, I was also able to merge the development and stable branches (of both tpclient-pywx and libtpclient-py) into one repository. This was a little bit trickier then I would have liked, it involved finding the branch point manually and then telling tailor about it, in the end it worked out. You can find a copy of the config I used for branching here.

You can see the results of our conversion at our gitweb.

I have to say, I’m amazed by git. Every single operation is very, very fast, I guess it’s why they called themselves “Git – Fast Version Control System”. Another thing that amazes me is the size of the repositories, under darcs our repositories where about 4Gb, with git they are around 200Mb! Overall, I’m happy with our choice.

darcs almost perfect.

Darcs is a really cool SCM system. We use it for Thousand Parsec and I really like all the way it works. However there are some very annoying bugs which keep pissing me off. So now I’m going to rant about what these problems are,

Using Massive amounts of memory with Binary files
Darcs is an absolute memory hog when you try and use it to manage even small binary files. I have seen it balloon to over 700mb on a little 7mb binary file. This keeps biting me in the arse because we are using darcs to manage our web repository. It’s starting to get so bad I’m thinking of switching that repository to subversion. We have already had to convert our media repository to subversion because of this problem :-/.
Not using good terminal interaction.
Darcs is design to be used interactively. However it crashes if you send it weird control characters or other strange stuff. It also doesn’t let you use the cursor keys to change long message title and such. Currently I have to use the “add long comment” if I want to fix anything in a patch title (which is very annoying for small patches).
Darcs being written in Haskel
By writing Darcs in Haskel I am unable to try and fix the above bugs. It is also the main reason using Darcs under “alternative” operating systems (such as Windows or Mac OS X) sucks so much (getting a working Haskell compiler is a real chore). Even when you do get it working it doesn’t quite fit properly (and the console IO is even more fragile). Mathematical correctness doesn’t mean you code doesn’t have any bugs. Being unusable is very much a huge bug.

It’s starting to get to the Stage that I’m considering other SCM tools such as Mercurial or maybe even monotone.

Using Tailor – Creating Subversion Repository for Thousand Parsec

To try and get our activity rating up on SourceForge I’m in the progress of trying to mirror our darcs repositories in SourceForge’s SVN repositories.

This would also be useful for things like oholh as JLP pointed out. It might make it easier for people to track the development version under Windows/Mac as they wouldn’t need to get a working darcs version.

To do this I need to use a program called Tailor which lets you convert between a wide range of different SCM systems. It took me a while to get a combination of tailor, darcs and svn which seems to work okay.

What I ended up with is the following Darcs to Subversion Conversion script.

Each time you run it, it rebuilds the svn repository from scratch. This was useful during testing so that I could get my comment formatting correct (and fiddle with the other settings).

A ran into another problem however, to use Tailor and get nice author and actual commit date you need the special hook installed. This hook is just an empty pre-revprop-change. However, SourceForge in all their wisdom don’t have support for this yet, there is a pending change request but it hasn’t been touched in about 3 months. Here is hoping they figure out something in the near future. There have been about 20 requests if you do a search for pre-revprop-change.