Requires File

The requires file is a file inside the repository which is used to describe the general format and layout of the repository. This provides a basic mechanism for introducing new repository formats. It is only written on repository creation, for instance during init or clone.

1. Details

Starting with Mercurial version 0.9.2 there is a file .hg/requires which specifies the capabilities needed by a client to access this repository. It is a text file, where each line contains the name of a capability and optionally (separated by a = character from the name) a list of parameters, each separated by a comma (,).

Currently there are only capabilities which don't need parameters.

The requires file only describes the format of the persistent representation of a repository on disk or backup media. Which is completely unrelated to how this information is transferred over the wire (for example, when pushing and pulling).

2. Older Mercurial versions

If an older Mercurial version tries to access a repository that was created by a newer Mercurial version, an error message like

abort: requirement 'dotencode' not supported!

may be displayed, which means the Mercurial version used to access that repository doesn't know how to interpret it, because accessing it would require knowledge about the 'dotencode' capability.

If such an error message appears, a newer Mercurial version must be used to access the repository or the repository must be converted to an older format understood by that version (by using 'hg clone --pull').

The format configuration option may be used to instruct Mercurial to create older repository formats. For example, to convert a 'dotencode' repository into the previous format, the command

hg --config format.dotencode=0 clone --pull repoA repoB

can be used, which of course requires a Mercurial version that supports the 'dotencode' capability.

3. Known requirements

4. See also


RequiresFile (last edited 2013-09-13 22:34:47 by mpm)