~thumper/bzr/alias-command

« back to all changes in this revision

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

  • Committer: Tim Penhey
  • Date: 2008-05-30 10:57:24 UTC
  • mfrom: (2900.1.561 +trunk)
  • Revision ID: tim@penhey.net-20080530105724-8494sid7i6ajilg4
Merge bzr.dev and resolve conflicts.

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
 
post_change_branch_tip
80
 
----------------------
 
107
 
 
108
post_change_branch_tip (Branch)
 
109
-------------------------------
81
110
 
82
111
Run after a branch tip has been changed but while the branch is still
83
112
write-locked. Note that push, pull, commit and uncommit all invoke this hook.
103
132
The old_revno and new_revno members are integers, as the head
104
133
revision is never has a dotted revision number.
105
134
 
106
 
set_rh
107
 
------
 
135
 
 
136
set_rh (Branch)
 
137
---------------
108
138
 
109
139
Note: This hook is now deprecated and will be removed in the near future.
110
140
Please use the ``post_change_branch_tip`` hook instead.
111
141
 
112
 
See also `Using hooks`_ in the User Guide.
113
 
 
114
 
.. _Using hooks: ../user-guide/index.html#using-hooks
 
142
 
 
143
server_started (SmartTCPServer)
 
144
-------------------------------
 
145
 
 
146
Invoked whenever the server starts serving a directory.
 
147
The hook signature is (backing urls, public url), where:
 
148
 
 
149
  backing_url
 
150
    A list of (string) URLs giving the server-specific directory locations.
 
151
 
 
152
  public_url
 
153
    The public URL for the directory.
 
154
 
 
155
 
 
156
server_stopped (SmartTCPServer)
 
157
-------------------------------
 
158
 
 
159
Invoked whenever the server stops serving a directory.
 
160
The hook signature is the same as ``server_started``.