Merge lp:~torkvemada/bzr/commit_hooks into lp:bzr
Status: | Needs review |
---|---|
Proposed branch: | lp:~torkvemada/bzr/commit_hooks |
Merge into: | lp:bzr |
Diff against target: |
244 lines (+153/-20) 3 files modified
bzrlib/commit.py (+94/-0) bzrlib/tests/per_workingtree/test_commit.py (+23/-20) bzrlib/tests/test_commit.py (+36/-0) |
To merge this branch: | bzr merge lp:~torkvemada/bzr/commit_hooks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Abstain | ||
Review via email: mp+115348@code.launchpad.net |
Description of the change
New class of hooks: commit ones; and the corresponding Commit.start_commit hook to enable commit metadata modification.
Rationale: there's a set of the metadata properties that are stored along with the commit itself, but at the moment there is no way to fetch or set any of them.
I suppose that since the interaction with all the metadata strictly belongs to commit itself, it's reasonable to create the hook, allowing plugin to modify the metadata for the Commit class.
As a proof of concept I have implemented the 'cimage' plugin[1], which utilizes the start_hook invented in this diff to add the user webcam photo to commit metadata. Later the photo can be fetched from metadata by appropriate command. Practically, all the cimage branch commits are equipped with the stored photos so one can easily install plugin, checkout that branch and view them.
[1] http://
Unmerged revisions
- 6544. By Vsevolod Velichko
-
Some test cases on which Commit.start_commit hook should fail.
- 6543. By Vsevolod Velichko
-
Do not pass all the commit data to the hook, but only some restricted set of properties.
- 6542. By Vsevolod Velichko
-
Remove unnecessary import in hook test
- 6541. By Vsevolod Velichko
-
Merge with trunk
- 6540. By Vsevolod Velichko
-
Test for commit.start_commit hook.
- 6539. By Vsevolod Velichko
-
Add commit.Commit hooks class and start_commit hook
Thanks for making these changes and explaining the merge proposal a little more. I've asked Jelmer to have a look.