diff mercurial/help/config.txt @ 34708:ee5f0d047b41

bookmark: add a dedicated txnclose-bookmark hook The new 'txnclose-bookmark' hook expose the bookmark movement information stored in 'tr.changes['bookmarks]'. To provide a simple and straightforward hook API to the users, we introduce a new hook called for each bookmark touched. Since a transaction can affect multiple bookmarks, updating the existing 'txnclose' hook to expose that information would be more complex. The data for all moves might 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 changeset. This does not exclude the addition to the full bookmark information to the existing 'txnclose' in the future to help write more complex hooks.
author Boris Feld <boris.feld@octobus.net>
date Tue, 10 Oct 2017 17:53:42 +0200
parents 23ed47a895d5
children c212947273a7
line wrap: on
line diff
--- a/mercurial/help/config.txt	Fri Oct 13 15:58:54 2017 -0400
+++ b/mercurial/help/config.txt	Tue Oct 10 17:53:42 2017 +0200
@@ -994,6 +994,18 @@
   after the lock is released. See :hg:`help config.hooks.pretxnclose` for
   details about available variables.
 
+``txnclose-bookmark``
+  Run after any bookmark 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 name of the bookmark will be available in ``$HG_BOOKMARK``, the new
+  bookmark location will be available in ``$HG_NODE`` while the previous
+  location will be available in ``$HG_OLDNODE``. In case of a bookmark
+  creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
+  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.