--- trac-post-commit-hook 2008-11-27 00:39:28.000000000 +0900 +++ trac-post-commit-hook 2009-09-11 14:51:52.000000000 +0900 @@ -136,7 +136,10 @@ 're': '_cmdRefs', 'references': '_cmdRefs', 'refs': '_cmdRefs', - 'see': '_cmdRefs'} + 'see': '_cmdRefs', + 'hours': '_cmdHours', + 'hour': '_cmdHours', + } def __init__(self, project=options.project, author=options.user, rev=options.rev, url=options.url): @@ -197,8 +200,16 @@ ticket['resolution'] = 'fixed' def _cmdRefs(self, ticket): - pass + if ticket['status'] == 'new': + ticket['status'] = 'assigned' + ticket['owner'] = self.author + def _cmdHours(self, ticket): + try: + match = re.search(ticket_prefix+'[0-9]+\s+([0-9\-\.]+)', self.msg).group(1) + ticket.values['hours'] = match + except Exception, e: + print>>sys.stderr, e if __name__ == "__main__": if len(sys.argv) < 5: