Needless to say, current Trac stable is 0.12.3, but of course development needs to go with your current version. (You didn't tell us in you question.)
On you question, there is a hint on how to implement different functionality on-top of the CommitTicketUpdater from Trac core. It has update and close as built-in actions, so you'll need to do some change like so (based on current Trac trunk
):
- create an additional option
commands_create
for commands, that create a new ticket with reference to the changeset, as a space-separated list
- add a class-wide variable
self.comment
in both of changeset_added
and changeset_modified
right after comment
assignment
add a module cmd_create
like (untested)
def cmd_create(self, ticket, changeset, perm):
if not self.check_perms or 'TICKET_CREATE' in perm:
# Commit messages in general is used for a ticket comment.
# New tickets require summary and we'll want description too,
# because comment is ignored on ticket creation.
# So we need to do message processing here beforehand.
ticket['comment'] = None
ticket['description'] = self.comment
ticket['owner'] = changeset.author
ticket['status'] = 'new'
ticket['summary'] = ' '.join(['TODO from', str(changeset.rev)])
ticket.insert()
alter ticket_command
so the regexp matches not only the default function-ticket(s) pairs but the unary 'TODO:' as well (sorry, can't make this working right-away now)
extend the private module _parse_message
to include another case before if func:
if cmd.startswith('TODO'):
tickets.update({None : ['create']})
continue
change _update_tickets
to make the comment saving conditional, because you won't need/want an additional comment on new tickets)
if ticket['comment']:
ticket.save_changes(changeset.author, comment, date, db)
Ok, ask back as required, if you like to try this approach.