Opened 10 years ago

Last modified 9 years ago

#1409 new defect

regex problem

Reported by: anonymous Owned by: javajunky
Priority: normal Component: BugzillaIssueTrackingPlugin
Severity: normal Keywords:
Cc: felmasper Trac Release: 0.10


if I put this plugin into different environments .

After I change projects . I got this error redefinition of group name

I am not familiar with python . I think there must be some wrong in group name

Attachments (2) (296 bytes) - added by felmasper 9 years ago. (992 bytes) - added by felmasper 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by felmasper

comment:1 Changed 9 years ago by felmasper

I had this very problem. Do you use multiple projects in a parent dir too?

I think the group names in regular expressions must be different accross projects.

A group is a way of matching a pattern (in this case the bug number) so you can use it later in a replace expression (so you can use the bugid in Bugzilla URL). If you know sed, it's kind \1 \2 etc. but with names instead of numbers.

It seems trac will join all regular expressions from all projects some time. Then you will have many "ticketid" groups. That's why it's showing "redefinition" (I guess).

So if you rename (manually) ocurrences of ticketid in each file you are done.

I'm attaching two files: one is a script that does exactly this automatically from a template. Here our apache user is group svn, so you must change the chown probably to match your user:group.

The second is the template itself. Put them on your trac/ root dir (supposing you have multiple projects inside it proj1 proj2 etc.). Then the script will copy the replacing the %NAME% formation in the template by the proj name. So you will have tiproj1 instead of ticketid in proj1, tiproj2 in proj2 and so on.

I will attach the files later on here.

Changed 9 years ago by felmasper

comment:2 Changed 9 years ago by felmasper

  • Cc felipe added; anonymous removed

I forgot to mention that in the shell script I cut down the proj name to four letters. So if you have more than one project with the same four initial letters, you must change it.

Let me know if your problem is solved. Then I will close this bug (if allowed).

Hmm... too bad... the reporter is anonymous. Bad for him/her.

comment:3 Changed 9 years ago by felmasper

  • Cc felmasper added; felipe removed

Add Comment

Modify Ticket

as new The owner will remain javajunky.

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

Note: See TracTickets for help on using tickets.