Darcs Workflows compared with Subversion

One of darcs key benefits is that it is interactive. That's illustrated below by comparing what's involved in using darcs for some common tasks, compared to using Subversion. The theme you'll see is that Subversion involves more manual work, as well as looking up and keeping tracking of revision numbers.

Sometimes in darcs it's helpful to remember patch or tag names, with the key difference being that you are matching names created by humans, not numbers incremented by a machine.

Task: Update, and review what's changed, skimming most things, but reviewing some patches in detail.

darcs

svn

darcs pull

1. note current revision.
2. svn update.
3. svn log; note revisions you want to review.
4. svn diff -r $rev for each revision to review

Note: Depending on whether developers check in with proper comments, this may or may not be much more painful than darcs

Task: Review any pending changes, remove some debugging statements and check them in

darcs

svn

1. darcs record
   # interactively skip debugging statements
2. darcs push
3. darcs revert

1. svn diff
# note the files and line numbers with debugging in them.
2. Manually open each file you noted, go to line numbers you reverted, and remove debugging.
3. svn commit

Task: A file contains a bug fix change, and an unrelated documentation fix. Check in each change separately.

darcs

svn

1. darcs record
   # select the bug fix and then "d" for done.
2. darcs record
   # select the typo fix and then "d" for done.

1. cp file.txt file.txt.copy
2. svn revert file.txt
3. Using a diff tool in an editor, manually re-apply the doc fix to the file.
4. svn commit file.txt # for the doc fix
5. mv file.txt.copy file.txt
6. svn commit file.txt # for the typo fix

Task: Merge a Branch

darcs

svn

Darcs merging is interactive by default. Merge everything or just specific patches, even if they aren't "next to each other" in the repository:
darcs pull 

In subversion, you have to use full URLs for branch paths, and keep track of revision numbers manually too. It's not interactive, so you have to select exactly what you want, possibly merging multiple times if the patches to merge don't appear in sequence:
svn merge -r 536:543
  svn+ssh://ardoursvn@ardour.org/ardour2/trunk
  svn+ssh://ardoursvn@ardour.org/ardour2/branches/region-plugins

DarcsWiki: WorkFlowsVsSubversion (last edited 2007-07-19 11:11:07 by pool-71-112-20-227)