Compatibility Rules

Mercurial has been used in production by major software projects since a couple months after its initial release. Thus, Mercurial has always made a serious effort to be backward compatible from release to release and from platform to platform with a minimum of surprises.

Here's an attempt to distill what our rules are:

1. File formats and layout

1.1. Path separator

All file system directory paths internal to Mercurial (in dirstate, changelog, manifest, in copy records, over the wire, etc.) are assumed to have a "/" path separator on all platforms (including Windows).

2. Commands

In particular, the output of core commands like 'hg log' and 'hg status' that are prime targets for stupid parsers cannot be changed without the addition of appropriate command line arguments. Suggestions to change the default output of these demands will not be patient.

Changes to error messages and ui.debug messages are usually fine as most of these messages are not intended for parsing. One important exception is hg log, which uses debug messages to show more detail. Adding messages at the verbose level is also usually acceptable.

3. Config Options

4. Hooks

5. Extensions

6. Wire protocol

7. Web interface

8. Internal API

The most stable view of the API will generally be through commands.py, simply because those functions are most directly exposed to the user.

See also: MercurialApi


CategoryContributing