Right, so you’ve decided to give darcs a spin, but you’re a little bit lost with this business of patches, pulling and what not. Here’s a custom guide for people who are used to Subversion. First of all, you might want to know about some DifferencesFromSubversion
Here is how to convert a SVN repository into a darcs repository, using Tailor .
Sadly, tailor, as of 0.9.35, does not correctly handle svn moves. This can be manually worked around when tailor fails by doing a
rm _darcs/index, fixing _darcs/patches/pending by erasing all the lines that incorrectly show adds of files that are in the moved directories (and probably also removes of files, which may be a different bug), doing
darcs record --all --pipe and putting in the requsite meta-information etc., and then ending with another
darcs check. Tailor should then be restarted from the next patch. At minimum this requires changing the config file to set the starting revision and removing the tailor.state* files.
Let us take the following project as an example:
http://code.google.com/p/ppss. First, install Tailor (
apt-get install tailor on Ubuntu/Debian). Then, in a file named
#!/usr/bin/env /usr/bin/tailor """ [DEFAULT] verbose = True patch-name-format=%(firstlogline)s remove-first-log-line=True [ppss] target = darcs:ppss root-directory = ppss_conversion source = svn:ppss subdir = ppss_darcs [darcs:ppss] darcs-command = darcs [svn:ppss] repository = http://ppss.googlecode.com/svn/ module = trunk """
What this recipe file means is that Tailor is going to create a
ppss_conversion directory where everything will happen, and inside it a
ppss_darcs directory that will contain the darcs version of the initial SVN repository.
Then make it executable (
chmod +x recipe.py) and run it. After a few minutes you will have your darcs repository. Of course this operation is much faster if the SVN repository you want to convert is located on your hard drive.
Moreover, Tailor enables you to maintain a two-way sync between a SVN repository and a Darcs repository:
This recipe can be easily adapted to convert a CVS repository to a darcs one.