Unlike Subversion, but like Git, Mercurial and Bazaar, Darcs is a distributed version control system. Repositories are islands which are constantly out of sync with each other, and Darcs takes care of integrating the changes that flow between them.
This system has several extremely useful effects:
- Offline mode. You can commit changes even if you’re on the road with no access to the server. That’s because your own working directory is a repository in its own right. When you get home, you do a
darcs pushto commit to the public server.
- Easy branching and merging. Every repository is a branch. There is no branch administration except pushing and pulling between repositories. See also DifferencesFromOtherDVCS.
- Easy patch sending by e-mail. I want to add a feature or bugfix to an open-source project. I make a local Darcs copy, apply my changes, then send my changes by email (
darcs send). The project’s maintainer(s) can decide whether to accept or reject the changes. This way, the maintainer(s) of the main repository do not need to give commit privileges to anyone else. This is how Darcs itself is maintained, by the way.
- Parallel development. Let’s say I follow the development of this open-source project, and I have some
controversialpatches that aren’t accepted by the official maintainers. No problem – I make my changes, release my own distribution. It’s a fork, of sorts, but it’s still connected to the mainline. Whenever the official project makes changes, I do a
darcs pullto get them, and resolve any conflicts. This way, my fork is kept up to date with the main project’s repository.
- Cherry-picking. If you’ve ever worked on a team, you will know that somebody often has a change you want, but which can’t be committed to the trunk yet. With Darcs you can grab just the one change by pulling it into your repository.
- Interactivity. When you record a patch, Darcs enables you to be precise and say “yes” or “no” to every change that you can include in your patch. Thus you can really create minimal patches, or separate your work in several patches, each one doing a consistent change. You can also tell Darcs to record everything in one patch by passing the
darcs record. Other commands, like
darcs push, behave the same.