Opened 3 years ago

Commits match against partial ticket number (i.e. commit refs #1045 ends up on ticket #10)

Reported by: Owned by: Marcus Lindblom richard normal TracTicketChangelogPlugin major 0.12

Description

Our commit comments use the fixes/refs/see system, which looks like

• Fixed framboozle in GUI. See #23 and #46. Fixes #23.
• Initial hogwash setup. See #1, #11 and #111.

The problem is that a commit that referenses ticket 100 ends up on ticket 1 and 10 as well.

I've tried using something like: .*?#%s[^0-9].* but the problem seems to be with the %s itself.

Or else it's a different bug altogether.

comment:1 Changed 3 years ago by richard

• Status changed from new to assigned

I tried your pattern, but did not get matched:

re.match(".*?#10[^0-9].*", "* See #100 and #46. Fixes #100.", re.M + re.S + re.U)


This changelog seems should not on ticket 10 as above test.

Could you show the exact comment and pattern?

comment:2 Changed 3 years ago by Marcus Lindblom <macke@…>

• Summary changed from Unable to figure out good pattern for comments _ending_ in ticket # to Commits match against partial ticket number (i.e. commit refs #1045 ends up on ticket #10)

Thanks for the quick response. Sorry for being so slow in return.

I've updated the summary to be more relevant w.r.t. my problem.

The previous pattern was slightly incorrect. I've tried with a slightly different one and got the same results. Perhaps there is a better way altogether.

Pattern: log_pattern = .*#%s[^0-9]*.*

Commit:

changeset:   1904:a42d4562ecb0
tag:         tip
user:        Marcus Lindblom <marcus.lindblom@orzone.se>
date:        Wed Nov 03 14:19:45 2010 +0100
summary:     OrzCPanel: Ask user if system is in correct position + better shutdown msg (fixes #1064)


Ticket #10 changelog:

Changeset	Author	Time	ChangeLog
[a42d4562ecb0231950446ef48cbb2f5314fef344]	Marcus Lindblom	2010-11-03	OrzCPanel: Ask user if system is in correct position + better shutdown msg (fixes #1064)
[8f89fd76a27c52782a100105e67e167ecd2019f2]	Daniel Svensson	2010-11-03	OrzCPanel: Added missing signal/slot connection for calibrated status in GUI. Fixes #1065
[5953bb2cbbb84d2c9ee16a408098f80b684515a1]	Daniel Svensson	2010-11-03	OrzCPanel: Maxon motors store calibrate status in volatile ram. (Fixes #1013) * Added necessary transitions to state machine to enable new functionality. * Added new function calibrateCheck in motors which checks that the calibrated flag is set. On maxonmotor the relevant bit on the controller is read. * Fixed Re-calibrate functionality. If all motors are calibrated and the user wishes to recalibrate, this now works. * Setup motor_config_dev.xml with same configuration as k6 system.
[bc03b4514883cc0cf50392a6847b2fed461e7a32]	Marcus Lindblom	2010-11-02	OrzCPanel: Swap via emulated motors when changing config file. See #1007
[e2f3ddf9891ed57663382b967aa614563e37929c]	Marcus Lindblom	2010-11-02	Dummy commit to test trac hook. see #10
[747256f9047c4621dab67364975275231c3ab449]	Marcus Lindblom	2010-11-02	Dummy commit to test trac hook. see #10


What exactly do you put in %s? is it ([0-9]+) or something different?

Also, how can I be sure that old changes are removed from the ticket? I currently use 'trac-admin . mercurial sync default' to re-sync changesets after I've changed the pattern. (I'm assuming the ticket<->changeset relations are stored in the database and not matched 'live' each time I view a ticket...)

Modify Ticket

Change Properties