/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/help_topics/en/hooks.txt

1st cut merge of bzr.dev r3907

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
.. _Using hooks: ../user-guide/index.html#using-hooks
14
14
 
15
 
The class of each hook is given immediately after each hook type below.
 
15
The class that contains each hook is given in parentheses immediately
 
16
after each hook type below.
 
17
 
 
18
Each description also indicates whether the hook runs on the client (the
 
19
machine where bzr was invoked) or the server (the machine addressed by
 
20
the branch URL).  These may be, but are not necessarily, the same machine.
 
21
 
 
22
Plugins (including hooks) are run on the server if any of these is true:
 
23
 
 
24
  * The remote branch is on the same machine as the client, and the client
 
25
    has plugins enabled.
 
26
 
 
27
  * The connection is via a smart server (accessed with a URL starting with
 
28
    "bzr://", "bzr+ssh://" or "bzr+http://", or accessed via a "http://"
 
29
    URL when a smart server is available via HTTP), and that server has
 
30
    plugins enabled.
 
31
 
 
32
 
 
33
open (Branch)
 
34
-------------
 
35
 
 
36
Called after a Branch object is opened, with the Branch object.
 
37
Runs on the client and on the server.
16
38
 
17
39
 
18
40
post_push (Branch)
19
41
------------------
20
42
 
21
43
Run after ``push`` has completed.
 
44
Runs on the client.
22
45
 
23
46
The hook signature is (push_result), containing the members
24
47
 
54
77
------------------
55
78
 
56
79
Run after ``pull`` has completed.
 
80
Runs on the client.
57
81
 
58
82
The hook signature is (push_result) containing the members
59
83
(source, local, master, old_revno, old_revid, new_revno, new_revid)
67
91
--------------------------
68
92
 
69
93
Run on the working tree before ``commit`` starts processing it.
 
94
Runs on the client.
 
95
 
70
96
Unlike the ``pre_commit`` hook (see below), the ``start_commit`` hook
71
97
can safely change the working tree.
72
98
 
77
103
-------------------
78
104
 
79
105
Run before ``commit`` has completed.
 
106
Runs on the client.
80
107
 
81
108
The hook signature is (local, master, old_revno, old_revid, future_revno,
82
109
future_revid, tree_delta, future_tree) where old_revno is NULL_REVISION for
90
117
--------------------
91
118
 
92
119
Run after ``commit`` has completed.
 
120
Runs on the client.
93
121
 
94
122
The hook signature is (local, master, old_revno, old_revid, new_revno,
95
123
new_revid) old_revid is NULL_REVISION for the first commit to a branch.
99
127
----------------------
100
128
 
101
129
Run after ``uncommit`` has completed.
 
130
Runs on the client.
102
131
 
103
132
The api signature is (local, master, old_revno, old_revid, new_revno,
104
133
new_revid) where local is the local branch or None, master is the target
109
138
-------------------------------
110
139
 
111
140
Run before a branch tip has been changed, while the branch is write-locked.
 
141
Runs on the client and on the server.
112
142
Note that push, pull, commit and uncommit all invoke this hook.
113
143
 
114
144
The hook signature is (params), where params is an object containing
137
167
-------------------------------
138
168
 
139
169
Run after a branch tip has been changed but while the branch is still
140
 
write-locked. Note that push, pull, commit and uncommit all invoke this hook.
 
170
write-locked.
 
171
Runs on the client and on the server.
 
172
Note that push, pull, commit and uncommit all invoke this hook.
141
173
 
142
174
The hook signature is (params), where params is an object containing
143
175
the members
168
200
Please use the ``post_change_branch_tip`` hook instead.
169
201
 
170
202
 
 
203
transform_fallback_location (Branch)
 
204
------------------------------------
 
205
 
 
206
Invoked as a stacked branch activates its fallback locations.
 
207
 
 
208
The hook signature is (branch, url) where:
 
209
 
 
210
  branch
 
211
    The branch being opened.  Note that as it does not yet have its
 
212
    fallback locations activated, the branch should be treated as
 
213
    half-built.
 
214
 
 
215
  url
 
216
    The URL that the branch specified for its fallback location.
 
217
 
 
218
The hook must return a URL for the branch containing the fallback
 
219
location. If multiple hooks are registered, the order in which they 
 
220
will be called is undefined and subject to change.
 
221
 
 
222
(New in 1.9)
 
223
 
 
224
 
171
225
server_started (SmartTCPServer)
172
226
-------------------------------
173
227
 
174
228
Invoked whenever the server starts serving a directory.
 
229
Runs on the server.
 
230
 
175
231
The hook signature is (backing urls, public url), where:
176
232
 
177
233
  backing_url
185
241
-------------------------------
186
242
 
187
243
Invoked whenever the server stops serving a directory.
 
244
Runs on the server.
 
245
 
188
246
The hook signature is the same as ``server_started``.
 
247
 
 
248
 
 
249
lock_acquired (LockDir)
 
250
----------------------------
 
251
 
 
252
Called with a LockResult object when a lock has been successfully acquired.
 
253
Runs on the client and on the server.
 
254
 
 
255
(New in 1.8.)
 
256
 
 
257
lock_released (LockDir)
 
258
----------------------------
 
259
 
 
260
Called with a LockResult object when a lock has been successfully released.
 
261
Runs on the client.
 
262
 
 
263
(New in 1.8.)
 
264
 
 
265
commit_message_template (msgeditor)
 
266
-----------------------------------
 
267
 
 
268
Invoked by commit to generate a commit message template.
 
269
Each hook can modify the commit message template.
 
270
The hook signature is (commit, start_message), where:
 
271
 
 
272
  commit
 
273
    A commit object, for the commit in progress
 
274
 
 
275
  start_message
 
276
    The original commit message, None initially.
 
277
 
 
278
The hook should return a new commit message template.
 
279
 
 
280
(New in 1.10.)