Modify

Opened 11 years ago

Last modified 11 years ago

#1409 new defect

regex problem

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

Description

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)

copybugplugin.sh (296 bytes) - added by Felipe Massia Pereira 11 years ago.
bugzilla.py.tmpl (992 bytes) - added by Felipe Massia Pereira 11 years ago.

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Felipe Massia Pereira

Attachment: copybugplugin.sh added

comment:1 Changed 11 years ago by Felipe Massia Pereira

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 bugzilla.py 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 bugzilla.py 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 11 years ago by Felipe Massia Pereira

Attachment: bugzilla.py.tmpl added

comment:2 Changed 11 years ago by Felipe Massia Pereira

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 11 years ago by Felipe Massia Pereira

Cc: Felipe Massia Pereira added; felipe removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain javajunky.

Add Comment


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

 
Note: See TracTickets for help on using tickets.