Add bzr commit notification hook to trac-bzr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trac-Bzr |
Fix Committed
|
Wishlist
|
Unassigned |
Bug Description
Trac 0.12 includes a plugin[1] to scan commit messages and automatically add comments and close tickets based on keywords in the message. This proces has to be triggered by hand, so it seems useful to include a bzr hook with trac-bzr that does so.
Attached is a proposed hook script that works for simple and shared repositories. The script uses the tip change hook, so it also works on updates and pushes.
The script also registers a command 'trac-project' to easily print and set the trac_project property in branch.conf file. It is not possible to set the trac_project property on a repository. So in a shared repository setup, the property has to be set on every branch. A warning is issued to inform the user about this.
The script could be installed in /usr/share/
If the script is invoked within a smartserver (e.g. commit to bzr+ssh:// location and the plugin is installed on the remote site), the script fails, complaining about accessing a location outside the server jail. I don't know yet how this can be fixed. I tried calling the trac-admin command by hand, but since I cannot get the local repos url (it gives /) that also failed for now.
[1] http://
[2] http://
Related branches
- Trac-bzr-team: Pending requested
-
Diff: 257 lines (+208/-2)4 files modifiedREADME (+21/-1)
bzrplugin/__init__.py (+93/-0)
bzrplugin/commands.py (+92/-0)
setup.py (+2/-1)
Changed in trac-bzr: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
importance: | Medium → Wishlist |
Changed in trac-bzr: | |
status: | Confirmed → Fix Committed |
Just to note that the hook in trace 0.12 ignores bzr revision properties, so you can't use things like "bzr commit --fixes " with it.