Opened 13 years ago
Last modified 18 months ago
#10681 new defect
commit_updater.py create wrong comment number
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | ticket system | Version: | 0.12.2 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to reproduce
- create new ticket A,B
- add a comment in ticket B
- commit message like below TWICE in hg
refs #B refs #A test commit updater
Expect result
Ticket A will have comment 1,2
Ticket B will have comment 1,2,3
In fact we get
Ticket A has comment 1,2
Ticket B has comment number 1,2,2
Attachments (0)
Change History (5)
comment:1 by , 12 years ago
Milestone: | → undecided |
---|
comment:2 by , 11 years ago
I have observed the same problem on our local trac site used for SVN. Additionally, I observed that when 3 tickets are referenced in a commit comment, the comment number on the first ticket is correct, the one in the second ticket is equal to the previous number, and the one in the third ticket is one less than the previous number.
After observing commit_updater.py, I think the problem is in ticket.save_changes()
and is the problem reported in #10465.
comment:4 by , 11 years ago
Could you be more explicit about what is wrong in save_changes()
? commit_updater.py
uses separate Ticket
instances for the various tickets it updates, so it's not obvious why the comment number would somehow persist across instances.
comment:5 by , 10 years ago
As already talked in other tickets, the query to get current comment number (in ticket.save_changes()
) was buggy, and seems to be the cause of this bug.
- comment:14:ticket:8947
If there are two transactions with the same timestamp but affecting different tickets, would this not be liable to return the comment values for all of the tickets? This in turn could result in the cnum being pulled from the incorrect ticket.
- comment:3:ticket:10465
Referenced ticket comments have the same time as the changeset, so that causes problems.
r10630 have fixed this bug in our environment.
All the tickets for {20} from last year have probably been seen multiple times by now, yet are still to be triaged…