Changesets Evolution Concept

/!\ This feature is experimental and is only partially implemented in core Mercurial.

Changesets evolution allows for safe rewriting of Mercurial history. This has a close relationship with Phases

1. Core principle

2. Additional ideas

3. Handled situations

4. Changeset Obsolescence

Obsolescence markers make it possible to mark changesets that have been deleted or superseded in a new version of the changeset.

Unlike the previous way of handling such changes, by stripping the old changesets from the repository, obsolescence markers can be propagated between repositories. This allows for a safe and simple way of exchanging mutable history and altering it after the fact. Changeset phases are respected, such that only draft and secret changesets can be altered (see hg phases for details).

Obsolescence is tracked using "obsolescence markers", a piece of metadata that tracks which changesets have been made obsolete, potential successors for a given changeset, the moment the changeset was marked as obsolete, and the user who performed the rewriting operation. The markers are stored separately from standard changeset data can be exchanged without any of the precursor changesets, preventing unnecessary exchange of obsolescence data.

The complete set of obsolescence markers describes a history of changeset modifications that is orthogonal to the repository history of file modifications. This changeset history allows for detection and automatic resolution of edge cases arising from multiple users rewriting the same part of history concurrently.

5. Troubled Changesets

There is three kind of **troubled changesets**

In some situation you may have non-obsolete changesets descending from obsolete changesets. Such changesets are said to be "unstable".

In some other situation you may have successors for changesets which are now immutable. In such case the obsolescence marker does not apply and the unlucky successors are said to be "bumped".

Finally when multiple changeset claim to be the successors of changesets they are said "divergent".

6. Current feature status

This feature is still at development stage. While most part of Mercurial are now aware of the concept, some works remains to be done on user interface and network aspect.

We do not recommend using this feature with version 2.5 of Mercurial unless you are an experienced user aware of the limitation of the current implementation.

7. State of the concept in version 2.5

Most history rewritting commands can now create obsolescences markers instead of stripping.

This behavior is disabled by default. You need to explicitly enable obsolescence support using EvolveExtension to get this behavior. When using obsolescence markers, thoses commandes are allowed to rewrite an arbitrary part of the history leaving untouched descendant behind as unstable.

log --graph will display use 'x' instead of 'o' to display obsolete changesets.

Obsolete changesets with no non-obsolete descendants are said to be "extinct" and are hidden to all mercurial commands and changesets exchanged. a --hidden switch is added globally to have them accessible again.

Obsolescence markers will be exchanged between repositories that explicitly assert support for the obsolescence feature (this can currently only be done via an extension).

Successors of a changeset are seen as valid destinations for bookmarks.

8. Experimental use

/!\ This feature is experimental! Do not try it unless you are an experienced Mercurial user.

A set of extensions experimenting around the obsolescence concept is provided by Logilab. It has prototype implementation for most of the final feature. See its documentation for details:

http://hg-lab.logilab.org/doc/mutable-history/html/

9. Older materials