Contains extension

This extension is not distributed with Mercurial.

Author: Christoph Rissner <cr@visotech.at>

Repository: http://bitbucket.org/resi/hg-contains/

Overview

This extension provides a contains command to test whether a changeset is a parent to another one. This can be used to test whether some changeset is contained in a branch or not. There is an option to look for transplanted changesets as well.

Configuration

Configure your .hgrc to enable the extension by adding following lines:

[extensions]
hgcontains=/path/to/contains.py

(with the actual path to your file, of course)

Usage

list of commands:

 contains          tests whether a changeset is parent to another one
 headscontaining   finds heads containing a specific changeset
 missing           finds changesets missing in a branch

To test whether a changeset is parent to another one

hg contains [-c child] [-t] [--revno] rev

tests whether a changeset is parent to another one

    This command tests whether the changeset given in 'rev' is a parent to
    the changeset given in 'child'. If no 'child' revision is given, the
    current working directory is used.
    If 'transplants' is given transplanted changesets are followed as well
    using the extra data set by the transplant command (which means the
    transplant sources must be in the same repo).

    If 'revno' is given the 'child' and 'rev' arguments are interpreted as
    revision numbers to prevent false positives due to pattern matching.
    You can use hashes instead of revision numbers to prevent pattern matching
    on the revision.

options:

 -c --child        check relationship to the given child changeset
 -t --transplants  check transplanted changesets
    --revno        interpret arguments as revision number (no pattern magic)

To find all heads containing a specific changeset use:

hg headscontaining [-t] [--revno] rev

finds heads containing a specific changeset

    This command shows all heads containing the changeset given in 'rev'.
    If 'transplants' is given transplanted changesets are followed as well
    using the extra data set by the transplant command (which means the
    transplant sources must be in the same repo).


    If 'revno' is given the 'rev' argument is interpreted as revision
    number to prevent false positives due to pattern matching.
    You can use hashes instead of revision numbers to prevent pattern matching
    on the revision.

options:

 -t --transplants  check transplanted changesets
    --revno        interpret argument as revision number (no pattern magic)

When working with several branches (say a development and a release branch) it may be interesting to see which changesets present in one branch are missing in the other (lets say you are looking for bugfixes and don't remember whether you've transplanted them or not):

hg missing [-M] [-t] [--revno] target source

finds changesets missing in a branch

    This command reports all changesets present in 'source' but not in
    'target'. Both arguments can be single changeset identifiers or ranges in
    the form <start>:<end>. If a range is given the first identifier is assumed
    to be the 'newer' one (the child node) and the second identifier is used as
    'older' changeset (the parent node). The function traverses the changeset
    graph from (including) the <start> changeset considering all parents newer
    or equal than <end> (using the revision numbers). This means the <end>
    changeset may or may not be an actual parent to <start>.
    If single changeset identifiers are given, all parent changesets are
    traversed.

    If 'transplants' is given transplanted changesets are considered as well.
    If a changeset is transplanted repeatedly (x -> x' -> x'') the transplanted
    nodes x' and x'' are not considered but only the original changeset x.
    The original changeset is determined following the extra data set by the
    transplant command, stopping if a node does not have this extra data or
    the transplant source is not found in the repo.

options:

 -t --transplants  check transplanted changesets
    --revno        interpret arguments as revision number (no pattern magic)
 -M --no-merges    do not show merges


CategoryExtensionsByOthers