Differences between revisions 15 and 16
Revision 15 as of 2013-01-20 23:01:27
Size: 5287
Editor: ScottPalmer
Comment: improved grammar
Revision 16 as of 2013-01-21 03:31:14
Size: 5309
Editor: rcl
Comment: fixed grammar further
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
/!\ this feature is experimental and only partially implement in core /!\ This feature is experimental and is only partially implemented in core Mercurial.
Line 21: Line 21:
== Additional idea == == Additional ideas ==
Line 27: Line 27:
== handled situation == == Handled situations ==
Line 29: Line 29:
 * Rewriting content of a changeset,
 * delete
/kill a changeset.
 * s
plit a single changeset into multiple ones,
 * c
ollapse multiple changeset into a single one,
 * change changeset order,
 * adding (eg
pulling) a changeset evolution that conflicts with another one.
 * a
dding (or adding in general ) new changesets on one which already evolved (or evolving a changeset that have descendant)
 * Rewriting content of a changeset
 * Deleting
/killing a changeset
 * S
plitting a single changeset into multiple ones
 * C
ollapsing/folding multiple changeset into a single one
 * Changing changeset order
 * Adding (e.g.
, pulling) a changeset evolution that conflicts with another one
 * A
dding (or adding in general) new changesets on one which already evolved (or evolving a changeset that have descendants)
Line 48: Line 47:
:hg:`hg phases` for details). `hg phases` for details).
Line 50: Line 49:
Obsolescence is tracked using "obsolete markers", a piece of metadata
tracking which changesets have been made obsolete, potential successors for
Obsolescence is tracked using "obsolescence markers", a piece of metadata
that tracks which changesets have been made obsolete, potential successors for
Line 71: Line 70:
Line 74: Line 72:
Commit --amend, rebase and histedit can now create obsolescence marker instead of stripping. This behavior is disable by default. You need to explicitly enable Obsolescence support to get this behavior. Commit --amend, rebase and histedit can now create obsolescence markers instead of stripping. This behavior is disabled by default. You need to explicitly enable Obsolescence support to get this behavior.
Line 81: Line 79:
    * hidden from log,
    * excluded from push, pull, clone,
    * selected by the 'obsolete()' revset.
    * hidden from log
    * excluded from push, pull, clone
    * selected by the 'obsolete()' revset
Line 88: Line 86:
    * push will refuse to push them without --force,
    * the 'unstable()' revset will select them,
    * their obsolete ancestors are displayed by log.
 * push will refuse to push them without --force,
 * the 'unstable()' revset will select them,
 * their obsolete ancestors are displayed by log.
Line 92: Line 90:
In some other situation you may have successors for changeset who are now [[immutable||Phases]]. In such case the obsolescence marker does not apply and the unlucky successors are said to be "bumped": In some other situation you may have successors for changesets which are now [[immutable||Phases]]. In such case the obsolescence marker does not apply and the unlucky successors are said to be "bumped":
Line 94: Line 92:
    * push will refuse to push them without --force,
    * the 'bumped()' revset will select them,
 * push will refuse to push them without --force,
 * the 'bumped()' revset will select them,
Line 107: Line 104:
Successors of a changeset are seen as valid destination for bookmarks. Successors of a changeset are seen as valid destinations for bookmarks.
Line 113: Line 110:
A set of extension experimenting around the obsolescence concept is provided by Logilab. It has prototype implementation for most of the final feature. See its documentation for details: 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:

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

  • Store an explicit obsolescence marker between new and old version of rewritten changeset.
  • This marker is *not* part of the changeset (should not alter the hash).
  • People are able to collaborate on evolving changeset

2. Additional ideas

  • Store final delta in a real and autonomous changeset.
  • The Obsolescence markers are exchangeable without rewritten changeset.
  • Easily allow other extension to manipulate such relation (and to hook on such operation)

3. Handled situations

  • Rewriting content of a changeset
  • Deleting/killing a changeset
  • Splitting a single changeset into multiple ones
  • Collapsing/folding multiple changeset into a single one
  • Changing changeset order
  • Adding (e.g., pulling) a changeset evolution that conflicts with another one
  • Adding (or adding in general) new changesets on one which already evolved (or evolving a changeset that have descendants)

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. Current feature status

This feature is still at an early stage of development. While several core behaviors have been adjusted to take obsolescence markers into account, some parts of Mercurial are still unaware of the new concept.

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

6. State of the concept in version 2.4

Commit --amend, rebase and histedit can now create obsolescence markers instead of stripping. This behavior is disabled by default. You need to explicitly enable Obsolescence support to get this behavior.

Some part of Mercurial comply with obsolescence marker, enforcing behavior as outlined below:

Changesets marked as obsolete are:

  • hidden from log
  • excluded from push, pull, clone
  • selected by the 'obsolete()' revset

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

  • push will refuse to push them without --force,
  • the 'unstable()' revset will select them,
  • their obsolete ancestors are displayed by log.

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":

  • push will refuse to push them without --force,
  • the 'bumped()' revset will select them,

Obsolete changesets with no non-obsolete descendants are said to be "extinct" and will appear when querying the "extinct()" revset.

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

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

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

7. 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/

8. Older materials

ChangesetEvolution (last edited 2022-08-14 21:06:00 by StephenRasku)