comparison mercurial/help/config.txt @ 34709:c212947273a7

bookmark: add a dedicated pretxnclose-bookmark hook This new hook mirror the newly introduced 'txnclose-bookmark' but can abort the transaction.
author Boris Feld <boris.feld@octobus.net>
date Sun, 08 Oct 2017 18:50:14 +0200
parents ee5f0d047b41
children cdf833d7de98
comparison
equal deleted inserted replaced
34708:ee5f0d047b41 34709:c212947273a7
986 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last 986 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
987 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and 987 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
988 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1`` 988 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
989 respectively, etc. 989 respectively, etc.
990 990
991 ``pretxnclose-bookmark``
992 Run right before a bookmark change is actually finalized. Any repository
993 change will be visible to the hook program. This lets you validate the
994 transaction content or change it. Exit status 0 allows the commit to
995 proceed. A non-zero status will cause the transaction to be rolled back.
996 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
997 bookmark location will be available in ``$HG_NODE`` while the previous
998 location will be available in ``$HG_OLDNODE``. In case of a bookmark
999 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1000 will be empty.
1001 In addition, the reason for the transaction opening will be in
1002 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1003 ``HG_TXNID``.
1004
991 ``txnclose`` 1005 ``txnclose``
992 Run after any repository transaction has been committed. At this 1006 Run after any repository transaction has been committed. At this
993 point, the transaction can no longer be rolled back. The hook will run 1007 point, the transaction can no longer be rolled back. The hook will run
994 after the lock is released. See :hg:`help config.hooks.pretxnclose` for 1008 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
995 details about available variables. 1009 details about available variables.
996 1010
997 ``txnclose-bookmark`` 1011 ``txnclose-bookmark``
998 Run after any bookmark change has been committed. At this point, the 1012 Run after any bookmark change has been committed. At this point, the
999 transaction can no longer be rolled back. The hook will run after the lock 1013 transaction can no longer be rolled back. The hook will run after the lock
1000 is released. 1014 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1001 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new 1015 about available variables.
1002 bookmark location will be available in ``$HG_NODE`` while the previous
1003 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1004 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1005 will be empty. In addition, the reason for the transaction opening will be
1006 in ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1007 ``HG_TXNID``.
1008 1016
1009 ``txnabort`` 1017 ``txnabort``
1010 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` 1018 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1011 for details about available variables. 1019 for details about available variables.
1012 1020