Mercurial_ The Definitive Guide - Bryan O'Sullivan [82]
This hook is run after a pre-existing changeset has been added to the repository, for example via a hg push. If a group of changesets was added in a single operation, this hook is called once for each added changeset.
You can use this hook for the same purposes as the changegroup hook (changegroup—After Remote Changesets Added); it’s simply more convenient sometimes to run a hook once per group of changesets, while other times it’s handier once per changeset.
Parameters to this hook:
node: A changeset ID. The ID of the newly added changeset.
source: A string. The source of these changes. See Sources of changesets for details.
url: A URL. The location of the remote repository, if known. See Where changes are going—remote repository URLs for more information.
See also: changegroup (changegroup—After Remote Changesets Added), prechangegroup (prechangegroup—Before Starting to Add Remote Changesets), pretxnchangegroup (pretxnchangegroup—Before Completing Addition of Remote Changesets)
outgoing—After Changesets Are Propagated
This hook is run after a group of changesets has been propagated out of this repository, for example by a hg push or hg bundle command.
One possible use for this hook is to notify administrators that changes have been pulled.
Parameters to this hook:
node: A changeset ID. The changeset ID of the first changeset of the group that was sent.
source: A string. The source of the operation (see Sources of changesets). If a remote client pulled changes from this repository, source will be serve. If the client that obtained changes from this repository was local, source will be bundle, pull, or push, depending on the operation the client performed.
url: A URL. The location of the remote repository, if known. See Where changes are going—remote repository URLs for more information.
See also: preoutgoing (preoutgoing—Before Starting to Propagate Changesets)
prechangegroup—Before Starting to Add Remote Changesets
This controlling hook is run before Mercurial begins to add a group of changesets from another repository.
This hook does not have any information about the changesets to be added, because it is run before transmission of those changesets is allowed to begin. If this hook fails, the changesets will not be transmitted.
One use for this hook is to prevent external changes from being added to a repository. For example, you could use this to “freeze” a server-hosted branch temporarily or permanently so that users cannot push to it, while still allowing a local administrator to modify the repository.
Parameters to this hook:
source: A string. The source of these changes. See Sources of changesets for details.
url: A URL. The location of the remote repository, if known. See Where changes are going—remote repository URLs for more information.
See also: changegroup (changegroup—After Remote Changesets Added), incoming (incoming—After One Remote Changeset Is Added), pretxnchangegroup (pretxnchangegroup—Before Completing Addition of Remote Changesets)
precommit—Before Starting to Commit a Changeset
This hook is run before Mercurial begins to commit a new changeset. It is run before Mercurial has any of the metadata for the commit, such as the files to be committed, the commit message, or the commit date.
One use for this hook is to disable the ability to commit new changesets, while still allowing incoming changesets. Another is to run a build or test, and only allow the commit to begin if the build or test succeeds.
Parameters to this hook:
parent1: A changeset ID. The changeset ID of the first parent of the working directory.
parent2: A changeset ID. The changeset ID of the second parent of the working directory.
If the commit proceeds, the parents of the working directory will become the parents of the new changeset.
See also: commit (commit—After a New Changeset Is Created), pretxncommit (pretxncommit—Before Completing Commit of New Changeset)
preoutgoing—Before Starting to Propagate Changesets
This hook