MigratingFromSubversion
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 DifferencesFromSubversionCVS
Darcs at a glance
First of all, Subversion tries to follow CVS as closely as it can. So any instructions for migrating from CVS are also applicable to Subversion. The following table is adapted from the section 'Switching from CVS' in the darcs manual
| Subversion idiom | Similar darcs idiom |
|---|---|
| svn checkout | darcs get |
| svn update | darcs pull |
| svn status -u | darcs pull --dry-run (summarize remote changes) |
| svn status | darcs whatsnew --summary (summarize local changes) |
| svn status | grep '?' | darcs whatsnew -ls | grep ^a (list potential files to add) |
| svn revert foo.txt | darcs revert foo.txt (revert to foo.txt from repo) |
| svn diff | darcs whatsnew (if checking local changes) |
| svn diff | darcs diff (if checking recorded changes) |
| svn commit | darcs record (if committing locally) |
| svn commit | darcs tag (if marking a version for later use) |
| svn commit | darcs push or darcs send (if committing remotely) |
| svn diff | mail | darcs send |
| svn add | darcs add |
| svn log | darcs changes |
| ? | darcs tag |
Converting repositories
Here is how to convert a SVN repository into a darcs repository, using Tailor .
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 recipe.py, paste:
#!/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: http://progetti.arstecnica.it/tailor/wiki/TwoWaySync
This recipe can be easily adapted to convert a CVS repository to a darcs one.
