On Apr 20, 7:12 am, Richie <[email protected]> wrote:
> Hello!
>
> I use the trac post-commit-hook successfull since a few month.
>
> But now I am a bit lazy and would like to drop the "refs-command"
> before ticket number in Subversion commit comments
>
> My Python programming skills are not very good, I tried to add the
> following lines before line 168 in trac-post-commit-hook from [1]:
>
>         for tkt_id in ticket_re.findall(self.msg):
>                     tickets.setdefault(tkt_id, []).append('_cmdRefs')
>
> But this doesn't work! I want every ticket found in commit comment
> gets an Trac Ticket comment.
>
> Whats wrong here?
>
> Thanks for your help!
>
> Richie
>
> [1]:http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook

do you no longer want to support refs, do you want refs to perform the
close action, or are you trying to get the word Refs removed from the
actual comment?

if you just want to not support it, you could just do the following:
128   class CommitHook:
129         _supported_cmds = {'close':      '_cmdClose',
130                            'closed':     '_cmdClose',
131                            'closes':     '_cmdClose',
132                            'fix':        '_cmdClose',
133                            'fixed':      '_cmdClose',
134                            'fixes':      '_cmdClose'}
135#                           'addresses':  '_cmdRefs',
136#                           're':         '_cmdRefs',
137#                           'references': '_cmdRefs',
138#                           'refs':       '_cmdRefs',
139#                           'see':        '_cmdRefs'}

or delete 135-139 after closing the dictionary at 134

I wouldn't even bother removing _cmdRefs, personally.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to