#1406 closed defect (fixed)
contrib trac-post-commit-hook should use env and Ticket objects
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | ticket system | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Instead of writing to the sqlite database directly, the post-commit-hook should use the Trac env and Ticket objects to manipulate the database. (Should assist in future db neutrality as well)
(See patch following for possible fix)
Attachments (1)
Change History (5)
by , 20 years ago
Attachment: | post-commit_using_env.1.diff added |
---|
comment:1 by , 20 years ago
comment:2 by , 20 years ago
thanks! that finally made my post-commit hook work. before i tried to debug the script by myself, but i don't have any knowledge of python and stumbled accross my own debug prints :) out of 20 tries, the hook worked 1 times… it always seemed to perform a commit and a rollback (but that my be related to my not existing knowledge) no it works perfectly each time
comment:3 by , 20 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Patch applied in [1497]. Thanks!
Note: There is a slight functionality change in this version. The original version would rollback all changes if one ticket update failed. (for instance, if an unknown ticket was referenced)
This version will update all the tickets that match, and print a warning to stderr if a ticket update fails. I felt that it would be odd if I referenced tickets, #1, and #2 — if #2 didn't exist, #1 wouldn't get updated.