/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

  • Committer: John Arbash Meinel
  • Date: 2008-07-08 14:55:19 UTC
  • mfrom: (3530 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3532.
  • Revision ID: john@arbash-meinel.com-20080708145519-paqg4kjwbpgs2xmq
Merge bzr.dev 3530

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Hooks
2
2
=====
3
3
 
4
 
post_push
5
 
---------
 
4
Introduction
 
5
------------
 
6
 
 
7
A hook of type *xxx* of class *yyy* needs to be registered using::
 
8
 
 
9
  yyy.hooks.install_named_hook("xxx", ...)
 
10
 
 
11
See `Using hooks`_ in the User Guide for examples.
 
12
 
 
13
.. _Using hooks: ../user-guide/index.html#using-hooks
 
14
 
 
15
The class of each hook is given immediately after each hook type below.
 
16
 
 
17
 
 
18
post_push (Branch)
 
19
------------------
6
20
 
7
21
Run after ``push`` has completed.
8
22
 
35
49
  new_revid
36
50
    The revision id (eg joe@foo.com-5676566-boa234a) after the push.
37
51
 
38
 
post_pull
39
 
---------
 
52
 
 
53
post_pull (Branch)
 
54
------------------
40
55
 
41
56
Run after ``pull`` has completed.
42
57
 
47
62
is read-locked and the target branches are write-locked. Source will
48
63
be the local low-latency branch.
49
64
 
50
 
pre_commit
51
 
----------
52
 
 
53
 
Run prefore ``commit`` has completed.
 
65
 
 
66
start_commit (MutableTree)
 
67
--------------------------
 
68
 
 
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.
 
72
 
 
73
The hook signature is (tree) where tree is a MutableTree object.
 
74
 
 
75
 
 
76
pre_commit (Branch)
 
77
-------------------
 
78
 
 
79
Run before ``commit`` has completed.
54
80
 
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
60
86
and future_tree.
61
87
 
62
 
post_commit
63
 
-----------
 
88
 
 
89
post_commit (Branch)
 
90
--------------------
64
91
 
65
92
Run after ``commit`` has completed.
66
93
 
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.
69
96
 
70
 
post_uncommit
71
 
-------------
 
97
 
 
98
post_uncommit (Branch)
 
99
----------------------
72
100
 
73
101
Run after ``uncommit`` has completed.
74
102
 
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.
78
106
 
79
 
set_rh
80
 
------
81
 
 
82
 
Run after the branch's revision history has been modified (push, pull, commit
83
 
and uncommit can all modify the revision history).
84
 
 
85
 
The hook signature is (branch, revision_history), and the branch will be
86
 
write-locked.
87
 
 
88
 
See also `Using hooks`_ in the User Guide.
89
 
 
90
 
.. _Using hooks: ../user-guide/index.html#using-hooks
 
107
 
 
108
pre_change_branch_tip (Branch)
 
109
-------------------------------
 
110
 
 
111
Run before a branch tip has been changed, while the branch is write-locked.
 
112
Note that push, pull, commit and uncommit all invoke this hook.
 
113
 
 
114
The hook signature is (params), where params is an object containing
 
115
the members
 
116
 
 
117
  branch
 
118
    The branch whose tip has been changed.
 
119
 
 
120
  old_revno
 
121
    The revision number (eg 10) of the branch before the change.
 
122
 
 
123
  old_revid
 
124
    The revision id (eg joe@foo.com-1234234-aoeua34) before the change.
 
125
 
 
126
  new_revno
 
127
    The revision number (eg 12) of the branch after the change.
 
128
 
 
129
  new_revid
 
130
    The revision id (eg joe@foo.com-5676566-boa234a) after the change.
 
131
 
 
132
The old_revno and new_revno members are integers, as the head
 
133
revision never has a dotted revision number.
 
134
 
 
135
 
 
136
post_change_branch_tip (Branch)
 
137
-------------------------------
 
138
 
 
139
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.
 
141
 
 
142
The hook signature is (params), where params is an object containing
 
143
the members
 
144
 
 
145
  branch
 
146
    The branch whose tip has been changed.
 
147
 
 
148
  old_revno
 
149
    The revision number (eg 10) of the branch before the change.
 
150
 
 
151
  old_revid
 
152
    The revision id (eg joe@foo.com-1234234-aoeua34) before the change.
 
153
 
 
154
  new_revno
 
155
    The revision number (eg 12) of the branch after the change.
 
156
 
 
157
  new_revid
 
158
    The revision id (eg joe@foo.com-5676566-boa234a) after the change.
 
159
 
 
160
The old_revno and new_revno members are integers, as the head
 
161
revision never has a dotted revision number.
 
162
 
 
163
 
 
164
set_rh (Branch)
 
165
---------------
 
166
 
 
167
Note: This hook is now deprecated and will be removed in the near future.
 
168
Please use the ``post_change_branch_tip`` hook instead.
 
169
 
 
170
 
 
171
server_started (SmartTCPServer)
 
172
-------------------------------
 
173
 
 
174
Invoked whenever the server starts serving a directory.
 
175
The hook signature is (backing urls, public url), where:
 
176
 
 
177
  backing_url
 
178
    A list of (string) URLs giving the server-specific directory locations.
 
179
 
 
180
  public_url
 
181
    The public URL for the directory.
 
182
 
 
183
 
 
184
server_stopped (SmartTCPServer)
 
185
-------------------------------
 
186
 
 
187
Invoked whenever the server stops serving a directory.
 
188
The hook signature is the same as ``server_started``.