2659.3.9
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.8
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.7
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.6
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.5
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.4
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.3
|
|
Changed ``pre_commit`` hook signature.
The hook's signature is now
::
hook(local, master, old_revno, old_revid, new_revno, new_revid, affected_ids, future_revision_tree)
``affected_ids`` is a dictionary of (change_type, ids). change_type is a string describing the change (e.g. 'added', 'deleted', 'modified'), and ids is a list of inventory entry ids.
Hooks can get an added file easier than before:
::
for id in affected_ids.get('added', []): if future_revision_tree.kind(id) == 'file': file = future_revision_tree.get_file(id) ...
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.2
|
|
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659.3.1
|
|
``Branch.hooks`` now supports ``pre_commit`` hook.
The hook's signature is
::
hook(local, master, old_revno, old_revid, new_revno, new_revid, deleted_paths, added_paths, future_revision_tree)
``deleted_paths`` and ``added_paths`` are lists of paths. Renamed paths are recorded in both ``deleted_paths`` and ``added_paths`` (i.e. deleted then added).
``future_revision_tree`` is obtained from ``CommitBuilder.revision_tree`` to save hooks from getting it from the branch again.
For example, hooks can get a file:
::
for path in added_paths: id = future_revision_tree.path2id(path) if future_revision_tree.kind(id) == 'file': file = future_revision_tree.get_file(id) ...
or export a tree and do ``make check`` or similar
::
import bzrlib.export bzrlib.export.export(future_revision_tree, 'tmp_space')
If the commit is to be rejected, hooks should raise an ``Exception``.
|
NamNguyen |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2659
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2658
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2657
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2656
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2655
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2654
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2653
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2652
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2651
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2650
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
2649
|
|
|
Canonical.com Patch ... |
17 years ago
|
![Diff](/static/images/ico_diff.gif) |
|