Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 18 years ago

#1406 closed defect (fixed)

contrib trac-post-commit-hook should use env and Ticket objects

Reported by: jason@… 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)

post-commit_using_env.1.diff (4.1 KB ) - added by jason@… 20 years ago.

Download all attachments as: .zip

Change History (5)

by jason@…, 20 years ago

comment:1 by jason@…, 20 years ago

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.

comment:2 by outi <outi@…>, 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 Christopher Lenz, 20 years ago

Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

comment:4 by Christopher Lenz, 20 years ago

Resolution: fixed
Status: assignedclosed

Patch applied in [1497]. Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.