7
A hook of type *xxx* of class *yyy* needs to be registered using::
9
yyy.hooks.install_named_hook("xxx", ...)
11
See `Using hooks`_ in the User Guide for examples.
13
.. _Using hooks: ../user-guide/index.html#using-hooks
15
The class of each hook is given immediately after each hook type below.
7
21
Run after ``push`` has completed.
47
62
is read-locked and the target branches are write-locked. Source will
48
63
be the local low-latency branch.
53
Run prefore ``commit`` has completed.
66
start_commit (MutableTree)
67
--------------------------
69
Run on the working tree before ``commit`` starts processing it.
70
Unlike the ``pre_commit`` hook (see below), the ``start_commit`` hook
71
can safely change the working tree.
73
The hook signature is (tree) where tree is a MutableTree object.
79
Run before ``commit`` has completed.
55
81
The hook signature is (local, master, old_revno, old_revid, future_revno,
56
82
future_revid, tree_delta, future_tree) where old_revno is NULL_REVISION for
59
85
obtained from CommitBuilder.revision_tree(). Hooks MUST NOT modify tree_delta
65
92
Run after ``commit`` has completed.
67
94
The hook signature is (local, master, old_revno, old_revid, new_revno,
68
95
new_revid) old_revid is NULL_REVISION for the first commit to a branch.
98
post_uncommit (Branch)
99
----------------------
73
101
Run after ``uncommit`` has completed.
76
104
new_revid) where local is the local branch or None, master is the target
77
105
branch, and an empty branch receives new_revno of 0, new_revid of None.
82
Run after the branch's revision history has been modified (push, pull, commit
83
and uncommit can all modify the revision history).
85
The hook signature is (branch, revision_history), and the branch will be
88
See also `Using hooks`_ in the User Guide.
90
.. _Using hooks: ../user-guide/index.html#using-hooks
108
post_change_branch_tip (Branch)
109
-------------------------------
111
Run after a branch tip has been changed but while the branch is still
112
write-locked. Note that push, pull, commit and uncommit all invoke this hook.
114
The hook signature is (params), where params is an object containing
118
The branch whose tip has been changed.
121
The revision number (eg 10) of the branch before the change.
124
The revision id (eg joe@foo.com-1234234-aoeua34) before the change.
127
The revision number (eg 12) of the branch after the change.
130
The revision id (eg joe@foo.com-5676566-boa234a) after the change.
132
The old_revno and new_revno members are integers, as the head
133
revision is never has a dotted revision number.
139
Note: This hook is now deprecated and will be removed in the near future.
140
Please use the ``post_change_branch_tip`` hook instead.
143
server_started (SmartTCPServer)
144
-------------------------------
146
Invoked whenever the server starts serving a directory.
147
The hook signature is (backing urls, public url), where:
150
A list of (string) URLs giving the server-specific directory locations.
153
The public URL for the directory.
156
server_stopped (SmartTCPServer)
157
-------------------------------
159
Invoked whenever the server stops serving a directory.
160
The hook signature is the same as ``server_started``.