~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(jelmer) Support upgrading between the 2a and development-colo formats.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Hooks
2
 
=====
3
 
 
4
 
post_push
5
 
---------
6
 
 
7
 
Run after ``push`` has completed.
8
 
 
9
 
The hook signature is (push_result), containing the members
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.
37
 
 
38
 
post_pull
39
 
---------
40
 
 
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
 
 
50
 
pre_commit
51
 
----------
52
 
 
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
 
 
62
 
post_commit
63
 
-----------
64
 
 
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
71
 
-------------
72
 
 
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
77
 
branch, and an empty branch receives new_revno of 0, new_revid of None.
78
 
 
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