next up previous contents
Next: GNU General Public License Up: Darcs 0.9.12 David's advanced Previous: Theory of patches   Contents

Subsections


Repository format

A repository consists of a working directory, which has within it a directory called _darcs. There must also be subdirectories within _darcs named current and patches. The current directory contains the version of the tree which has been recorded, while patches contains the actual patches which are in the repository.

Also within _darcs is the inventory file, which lists all the patches that are in the repo. Moreover, it also gives the order of the representation of the patches as they are stored. Given a source of patches, i.e. any other set of repositories which have between them all the patches contained in a given repo, that repo can be reproduced based on only the information in the inventory file. Under those circumstances, the order of the patches specified in the inventory file would be unimportant, as this order is only needed to provide context for the interperetation of the stored patches in this repository.

There is a very special patch which may be stored in patches which is called `pending'. This patch describes any changes which have not yet been recorded, and cannot be determined by a simple diff. For example file additions or renames are placed in pending until they are recorded. Similarly, token replaces are stored in pending until they are recorded.

prefs

The _darcs directory will also typically contain a prefs directory. This directory exists simply to hold user configuration settings specific to this repository. This directory may be freely deleted, and its contents are intended to be modifiable by the user, although a mistake in such a modification may cause darcs to behave strangely or cause your cat to cough up a hairball.

defaults

Default values for darcs commands can be configured on a per-repository basis by editing (and possibly creating) the _darcs/prefs/defaults file. Each line of this file has the following form:

COMMAND FLAG VALUE
where COMMAND is either the name of the command to which the default applies, or ALL to indicate that the default applies to all commands accepting that flag. The FLAG term is the name of the long argument option without the ``--'', i.e. verbose rather than --verbose. Finally, the VALUE option can be omitted if the flag is one such as verbose that doesn't involve a value.

For example, if your system clock is bizarre, you could instruct darcs to always ignore the file modification times by adding the following line to your _darcs/prefs/defaults file. (Note that this would have to be done for each repository!)

ALL ignore-times

If you never want to run a test when recording to a particular repository (but still want to do so when running check on that repo), and like to name all your patches ``Stupid patch'', you could use the following:

record no-test
record patch-name Stupid patch

repos

The _darcs/prefs/repos file contains a list of repositories you have pulled from or pushed to, and is used for autocompletion of pull and push commands in bash. Feel free to delete any lines from this list that might get in there, or to delete the file as a whole.

boring

The _darcs/prefs/boring file may contain a list of regular expressions describing files, such as object files, that you do not expect to add to your project. As an example, the boring file that I use with my darcs repository is:
\.hi$
\.o$
^\.[^/]
^_
~$
(^|/)CVS($|/)
The last line is actually irrelevant because I don't use CVS, but if I did it would be handy. You may want to have the boring file under version control. To do this you can use darcs setpref to set the value ``boringfile'' to the name of your desired boring file (e.g. ``darcs setpref boringfile ./.boring'', where the .boring is a file that has been darcs added to your repository). You could also use this to configure your repo to work with a global boring file, something like ``/etc/darcs/boring''.

binary

The _darcs/prefs/binaries file may contain a list of regular expressions describing files that should be treated as binary files rather than text files. You probably will want to have the binaries file under version control. To do this you can use darcs setpref to set the value ``binariesfile'' to the name of your desired binaries file (e.g. ``darcs setpref binariesfile ./.binaries'', where .binaries is a file that has been darcs added to your repository).


next up previous contents
Next: GNU General Public License Up: Darcs 0.9.12 David's advanced Previous: Theory of patches   Contents
David Roundy 2003-07-30