devel:darcs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
devel:darcs [2008-08-09 11:31] – created bln | devel:darcs [2010-03-13 15:45] (current) – 84.132.221.218 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== DokuWiki darcs repository ====== | ||
+ | |||
+ | **Until January 2010, the [[: | ||
+ | |||
+ | //Darcs is a replacement for CVS. Darcs is simple to learn and use, with a powerful new approach to meet the needs of today' | ||
+ | |||
+ | ===== How to use darcs ===== | ||
+ | |||
+ | Instead of repeating things that were said elsewhere I just want to give some pointers: | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== Using darcs for DokuWiki ===== | ||
+ | |||
+ | To fetch the current development version of DokuWiki use the following command (This creates the directory **dokuwiki** for you): | ||
+ | |||
+ | darcs get --partial http:// | ||
+ | |||
+ | To update an existing checkout use this command from within the DokuWiki directory: | ||
+ | |||
+ | darcs pull | ||
+ | |||
+ | When you create a new source file, use this command to add it to the darcs repository: | ||
+ | |||
+ | darcs add somenewfile | ||
+ | |||
+ | When you're finished with your changes use: | ||
+ | |||
+ | darcs record | ||
+ | |||
+ | This will scan your local darcs repository to find the changes that have occurred and will locally " | ||
+ | |||
+ | To get your changes included in the official tree, create a patchfile: | ||
+ | |||
+ | darcs send -o my_doku_patch_file | ||
+ | |||
+ | This creates a patch file that can be mailed manually to the [[: | ||
+ | |||
+ | ==== Tips and Tricks ==== | ||
+ | |||
+ | * :!: Always pull before starting to work on new patches, to make sure you don't create conflicts. | ||
+ | * :!: Never use the '' | ||
+ | * Make sure your editor does not change line endings (from Unix LF to DOS CRLF), this would result in a complete file replace, instead of a small patch because each line was changed. | ||
+ | * Make a patch for a single feature. When you worked on two different features (eg, a language fix and a function update), '' | ||
+ | |||
+ | * Patches should be sent to the [[: | ||
+ | * Do not worry about the patch file size. darcs patches tend to be big even for small changes. Space is cheap. | ||
+ | * Some mail clients/ | ||
+ | |||
+ | * A web interface to the darcs repository is available at [[http:// | ||
+ | |||
+ | ==== Mixing the official tree with own patches ==== | ||
+ | |||
+ | Because each checkout is its own repository people can keep their own modifications as patchsets and can still update from the " | ||
+ | |||
+ | So how does this work in practice? Darcs can't do magic, if you change something in your local repository and the same is changed in the " | ||
+ | |||
+ | However if you make minor changes that aren't touched in the upstream version you should get no problem when updating from the official repository. This is because darcs just applies patches. As long as darcs finds enough context to apply the patch it should work. | ||
+ | |||
+ | For example if you add some HTML to one of the functions in '' | ||
+ | |||
+ | ==== Maintaining a stable version with darcs ==== | ||
+ | |||
+ | Darcs isn't only for DokuWiki developers, it can be used to get the latest stable version and to update to the next stable version when it is released. | ||
+ | |||
+ | To get a particular release of DokuWiki (replace yyyy-mm-dd with the date of the release, e.g. 2006-11-06): | ||
+ | |||
+ | darcs get --partial --tag=" | ||
+ | |||
+ | Unfortunately darcs contains a [[http:// | ||
+ | |||
+ | darcs get --tag=" | ||
+ | |||
+ | To update to a specific release, a release candidate or the latest release (stable): | ||
+ | |||
+ | darcs pull --tags " | ||
+ | darcs pull --tags " | ||
+ | darcs pull --tags " | ||
+ | |||
+ | The '' | ||
+ | |||
+ | === Updating when you have customized DokuWiki === | ||
+ | |||
+ | If you have made your own changes to DokuWiki' | ||
+ | |||
+ | darcs pull --tags " | ||
+ | darcs pull --tags " | ||
+ | darcs pull --tags " | ||
+ | |||
+ | At the end of the patching process Darcs will let you know if there were any conflicts between your changes and the patches applied to make the new version. You can then examine the files in question and make any necessary changes. | ||
+ | |||
+ | You can use the following command to keep track of the changes you have made to DokuWiki: | ||
+ | |||
+ | darcs whatsnew | ||
+ | |||
+ | When run interactively the revert command will do something similar and give you the opportunity to remove your changes if they are no longer required. | ||
+ | |||
+ | ===== Why Darcs? ===== | ||
+ | |||
+ | So why did I choose [[http:// | ||
+ | |||
+ | Darcs has, in my opinion, several advantages: | ||
+ | |||
+ | * it needs no special server for anonymous readonly access -- any HTTP server is enough | ||
+ | * it can manage directories (same goes for SVN and arch) | ||
+ | * it is fully distributed, | ||
+ | * no complicated naming scheme is needed (as in arch) | ||
+ | * independent patchsets (see below) | ||
+ | * makes contributing and applying contributions easy (through '' | ||
+ | |||
+ | There are some disadvantages though: | ||
+ | |||
+ | * it's a little buggy sometimes (though not critically) | ||
+ | * it's relatively unknown yet | ||
+ | |||
+ | |||
+ | What I like most are the patchsets. Because each checkout is its own repository people can keep their own modifications as patchsets and can still update from my " | ||
+ | |||