Modify ↓
#1195 closed defect (fixed)
Post commit script failing with extra ticket numbers in log
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | 0.8.1 |
Component: | general | Version: | 0.8 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
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 (0)
Change History (2)
comment:1 by , 20 years ago
Milestone: | → 0.8.1 |
---|
comment:2 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Looks like a low-risk change, so we could put it in 0.8.1.