Mercurial > hg
diff mercurial/help/config.txt @ 34710:cdf833d7de98
phase: add a dedicated txnclose-phase hook
The new 'txnclose-phase' hook expose the phase movement information stored in
'tr.changes['phases]'. To provide a simple and straightforward hook API to the
users, we introduce a new hook called for each revision affected. Since a
transaction can affect the phase of multiple changesets, updating the existing
'txnclose' hook to expose that information would be more complex. The data for
all moves will not fit in environment variables and iterations over each move
would be cumbersome. So the introduction of a new dedicated hook is
preferred in this changesets.
This does not exclude the addition of the full phase movement information to
the existing 'txnclose' in the future to help write more complex hooks.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sun, 08 Oct 2017 17:50:46 +0200 |
parents | c212947273a7 |
children | f6d17075608f |
line wrap: on
line diff
--- a/mercurial/help/config.txt Sun Oct 08 18:50:14 2017 +0200 +++ b/mercurial/help/config.txt Sun Oct 08 17:50:46 2017 +0200 @@ -1014,6 +1014,16 @@ is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details about available variables. +``txnclose-phase`` + Run after any phase change has been committed. At this point, the + transaction can no longer be rolled back. The hook will run after the lock + is released. + The affected node is available in ``$HG_NODE``, the new phase will be + available in ``$HG_PHASE`` while the previous phase will be available in + ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE`` will be empty. In + addition, the reason for the transaction opening will be in ``$HG_TXNNAME``, + and a unique identifier for the transaction will be in ``HG_TXNID``. + ``txnabort`` Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` for details about available variables.