~bzr-pqm/bzr/bzr.dev

3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
1
Hooks
2
=====
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
3
4
post_push
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
5
---------
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
6
7
Run after ``push`` has completed.
8
9
The hook signature is (push_result), containing the members
3026.2.1 by John Arbash Meinel
Updated post-push hook to have the correct info
10
11
  source_branch
12
    Where the data is being pushed from (read locked).
13
    This should be the lowest latency branch.
14
15
  target_branch
16
    The direct location where data is being sent (write locked).
17
18
  master_branch
19
    Either target_branch, or if the target is a bound branch, it
20
    will be the master location (write locked).
21
22
  local_branch
23
    If the target is a bound branch, this will be the target
24
    branch, else it will be None.
25
26
  old_revno
27
    The revision number (eg 10) of the branch before the push.
28
29
  old_revid
30
    The revision id (eg joe@foo.com-1234234-aoeua34) before the push.
31
32
  new_revno
33
    The revision number (eg 12) of the branch after the push.
34
35
  new_revid
36
    The revision id (eg joe@foo.com-5676566-boa234a) after the push.
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
37
38
post_pull
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
39
---------
40
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
41
Run after ``pull`` has completed.
42
43
The hook signature is (push_result) containing the members
44
(source, local, master, old_revno, old_revid, new_revno, new_revid)
45
where local is the local target branch or None, master is the target 
46
master branch, and the rest should be self explanatory. The source
47
is read-locked and the target branches are write-locked. Source will
48
be the local low-latency branch.
49
2659.3.10 by Nam Nguyen
merge with bzr.dev and update hooks.txt to list pre_commit hook.
50
pre_commit
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
51
----------
52
2659.3.10 by Nam Nguyen
merge with bzr.dev and update hooks.txt to list pre_commit hook.
53
Run prefore ``commit`` has completed.
54
55
The hook signature is (local, master, old_revno, old_revid, future_revno,
56
future_revid, tree_delta, future_tree) where old_revno is NULL_REVISION for
57
the first commit to a branch, tree_delta is a TreeDelta object describing
58
changes from the basis revision, and future_tree is an in-memory tree
59
obtained from CommitBuilder.revision_tree(). Hooks MUST NOT modify tree_delta
60
and future_tree.
61
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
62
post_commit
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
63
-----------
64
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
65
Run after ``commit`` has completed.
66
67
The hook signature is (local, master, old_revno, old_revid, new_revno,
68
new_revid) old_revid is NULL_REVISION for the first commit to a branch.
69
70
post_uncommit
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
71
-------------
72
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
73
Run after ``uncommit`` has completed.
74
75
The api signature is (local, master, old_revno, old_revid, new_revno,
76
new_revid) where local is the local branch or None, master is the target
2769.1.1 by Kent Gibson
Tweak Hook documentation
77
branch, and an empty branch receives new_revno of 0, new_revid of None.
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
78
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
79
post_change_branch_tip
80
----------------------
81
82
Run after a branch tip has been changed but while the branch is still
83
write-locked. Note that push, pull, commit and uncommit all invoke this hook.
84
85
The hook signature is (params), where params is an object containing
86
the members
87
3331.1.8 by James Henstridge
Update help text to match change to params.
88
  branch
89
    The branch whose tip has been changed.
90
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
91
  old_revno
3331.1.8 by James Henstridge
Update help text to match change to params.
92
    The revision number (eg 10) of the branch before the change.
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
93
94
  old_revid
3331.1.8 by James Henstridge
Update help text to match change to params.
95
    The revision id (eg joe@foo.com-1234234-aoeua34) before the change.
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
96
97
  new_revno
3331.1.8 by James Henstridge
Update help text to match change to params.
98
    The revision number (eg 12) of the branch after the change.
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
99
100
  new_revid
3331.1.8 by James Henstridge
Update help text to match change to params.
101
    The revision id (eg joe@foo.com-5676566-boa234a) after the change.
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
102
3331.1.11 by James Henstridge
Note that the revision numbers are integers in the docs.
103
The old_revno and new_revno members are integers, as the head
104
revision is never has a dotted revision number.
105
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
106
set_rh
3089.3.1 by Ian Clatworthy
move reference material out of User Guide into User Reference
107
------
108
3323.2.1 by Ian Clatworthy
first cut at post_change_branch_tip hook
109
Note: This hook is now deprecated and will be removed in the near future.
110
Please use the ``post_change_branch_tip`` hook instead.
2767.2.2 by Aaron Bentley
Split hooks doc into guide and reference
111
3089.3.15 by Ian Clatworthy
fix some links
112
See also `Using hooks`_ in the User Guide.
3089.3.7 by Ian Clatworthy
tweak hooks help to improved readability as suggested by jameinel
113
114
.. _Using hooks: ../user-guide/index.html#using-hooks