Next: Darcs commands Up: Darcs User Manual Previous: Best practices Contents

# Repository Formats

Darcs 2 supports three repository formats:

- The current format, called `darcs-2'. It has the most features.
- The original format, called `darcs-1' or `old-fashioned inventory'. It is the only format supported by Darcs releases prior to 2.0. Patches cannot be shared between darcs-2 and darcs-1 repositories.
- An intermediary format, called `hashed'. It provides some of the features of darcs-2, while retaining the ability to exchange patches with darcs-1. Patches cannot be shared between darcs-2 and hashed repositories.

Note that references to the hashed format refer to hashed darcs-1 repositories. All darcs-2 repositories are also hashed, and `darcs show repo' in a darcs-2 repository will report the format as `hashed, darcs-2'.

The hashed (and darcs-2) format improves on the darcs-1 format in the following ways:

- Improved atomicity of operations. This improves the safety and efficiency of those operations.
- File names in the `pristine' copy of the working tree are hashed. This greatly reduces the chance of a program accidentally treating files in _darcs/pristine as part of the working tree.

  For example, in darcs-1 running `find -name "*.gif" -delete` instead of `find -name _darcs -prune -o -name "*.gif" -delete` would result in GIF files in pristine files being deleted.

- Support for `lazy' repositories. This causes patches to be copied from the parent repository on demand, rather than during the initial `darcs get'. For repositories that only operate on recent patches (such as feature branches), this reduces the repository's size, and the time and bandwidth taken to create it.

  Lazy repositories are first-class repositories, and all operations are supported as long as the parent repository remains accessible. This isn't the case for the `partial' feature of the darcs-1 format.

- Support for caches that are shared by all repositories. When operating on many similar repositories, the patches and pristine files they have in common are hard links to the cache. This greatly reduces storage requirements, and the time and bandwidth needed to make similar repositories.

The darcs-2 format improves on the hashed format in the following ways:

- The `exponential merge' problem is far less likely to occur (it can still be produced in deliberately pathological cases).
- Identical primitive changes no longer conflict. For example, if two patches both attempt to add a directory `tests', these patches will not conflict.

See also `darcs initialize' (), `darcs convert' () and `darcs get' ().

Next: Darcs commands Up: Darcs User Manual Previous: Best practices Contents