hg prune#

mark changesets as obsolete or succeeded by another changeset#

hg prune [OPTION]... [-r] REV...

Aliases: obsolete

This command is provided by the evolve extension.

Pruning changesets marks them obsolete, hiding them from the history log, provided they have no descendants. Otherwise, all such descendants that aren't themselves obsolete become "unstable". Use `hg evolve` to handle this situation.

When you prune the parent of your working copy, Mercurial updates the working copy to a non-obsolete parent.

You can use -s/--successor to tell Mercurial that a newer version (successor) of the pruned changeset exists. Mercurial records successor revisions in obsolescence markers.

If you prune a single revision and specify multiple revisions in -s/--successor, you are recording a "split" and must acknowledge it by passing --split. Similarly, when you prune multiple changesets with a single successor, you must pass the --fold option.

If you want to supersede multiple revisions at the same time, use the --pair option to pair the pruned precursor and successor changesets. This is commonly useful for resolving history divergence, or when someone else edits history without obsolescence enabled.

hg prune A::B -s C::D --pair will mark all revisions in the A::B range as superseded by the revisions in C::D. Both revsets need to have the same number of changesets.

Options

Every command accepts the global options.

-s

--successor REV [+]

successor changeset

-r

--rev REV [+]

revisions to prune

-k

--keep

does not modify working copy during prune

-n

--note TEXT

store a note on prune

--pair

record a pairing, such as a rebase or divergence resolution (pairing multiple precursors to multiple successors)

--fold

record a fold (multiple precursors, one successor)

--split

record a split (one precursor, multiple successors)

-B

--bookmark BOOKMARK [+]

remove revs only reachable from given bookmark

-d

--date DATE

record the specified date in metadata

-u

--user USER

record the specified user in metadata

--mq

operate on patch repository

Options marked [+] can be repeated.