Changeset 2654

Show
Ignore:
Timestamp:
09/23/07 08:27:43 (1 year ago)
Author:
coling
Message:

Fix a bug whereby ticket changes were broken when the status was NOT changed... Should allow messages to be left on closed tickets and for integration with the trac post commit hook to close tickets via svn log message.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • worklogplugin/0.10/worklog/manager.py

    r2571 r2654  
    7272            if change['permanent']: 
    7373                cnum += 1 
    74  
    7574        tckt.save_changes(self.authname, msg, self.now, db, cnum+1) 
     75        ## Often the time overlaps and causes a db error, 
     76        ## especially when the trac integration post-commit hook is used. 
     77        ## NOTE TO SELF. I DON'T THINK THIS IS NECESSARY RIGHT NOW... 
     78        #count = 0 
     79        #while count < 10: 
     80        #    try: 
     81        #        tckt.save_changes(self.authname, msg, self.now, db, cnum+1) 
     82        #        count = 42 
     83        #    except Exception, e: 
     84        #        self.now += 1 
     85        #        count += 1 
    7686        db.commit() 
    7787         
     
    192202            db = self.env.get_db_cnx() 
    193203            tckt = Ticket(self.env, active['ticket'], db) 
     204             
    194205            # This hideous hack is here because I don't yet know how to do variable-DP rounding in python - sorry! 
    195206            # It's meant to round to 2 DP, so please replace it if you know how.  Many thanks, MK. 
  • worklogplugin/0.10/worklog/ticket_daemon.py

    r2434 r2654  
    1111        """Called when a ticket is created.""" 
    1212        pass 
    13                                 
    14  
     13     
    1514    def ticket_changed(self, ticket, comment, author, old_values): 
    1615        """Called when a ticket is modified. 
     
    2120        if self.config.getbool('worklog', 'autostop') \ 
    2221               and 'closed' == ticket['status'] \ 
     22               and old_values.has_key('status') \ 
    2323               and 'closed' != old_values['status']: 
    2424            mgr = WorkLogManager(self.env, self.config)