Edgewall Software
Modify

Ticket #1195 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

Post commit script failing with extra ticket numbers in log

Reported by: bhv1@… Owned by: jonas
Priority: normal Milestone: 0.8.1
Component: general Version: 0.8
Severity: normal Keywords:
Cc:

Description

With the trac-post-commit-script in trac 0.8, if a user places a ticket number in the commit message without a known command preceeding it, all command/ticket combinations are ignored due to the rollback. The following patch fixes this by checking for the command before trying to use it. This allows the rollback to still occur for unknown exceptions.

--- /home/bhv1/trac-0.8/contrib/trac-post-commit-hook   2004-09-12 14:59:27.000000000 -0400
+++ /var/svn/private/trac-post-commit-hook      2005-02-09 16:52:10.000000000 -0500
@@ -123,7 +123,8 @@
         cmdGroups = commandPattern.findall(msg) 
         for cmd, tkts in cmdGroups:
             try:
-                getattr(self, CommitHook._supported_cmds[cmd.lower()])(ticketPattern.findall(tkts))
+                if CommitHook._supported_cmds.has_key(cmd.lower()):
+                    getattr(self, CommitHook._supported_cmds[cmd.lower()])(ticketPattern.findall(tkts))
             except: 
                 self.con.rollback()
         self.con.commit()

Attachments

Change History

comment:1 Changed 5 years ago by cmlenz

  • Milestone set to 0.8.1

Looks like a low-risk change, so we could put it in 0.8.1.

comment:2 Changed 5 years ago by cmlenz

  • Status changed from new to closed
  • Resolution set to fixed

Patch applied in [1246], ported to 0.8 stable in [1247].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.