def changeset_added(self, repos, changeset): if self._is_duplicate(changeset): return tickets = self.parse_message(changeset.message) if self.ticket_comments: comment = self.make_ticket_comment(repos, changeset) self._update_tickets(tickets, changeset, comment, datetime.now(utc)) # Add rev to ticket changesets tkt_changesets = TicketChangesets(self.env) for tkt_id, cmds in tickets.iteritems(): tkt_changesets.add(tkt_id, repos.id, changeset.rev)
def __init__(self, env, context, tkt_id, hint='ticket'): self.env = env self.context = context self.tkt_id = tkt_id self.hint = hint self.compact = env.config.getbool('ticket-changesets', 'compact') self.changesets = TicketChangesets(env).get(tkt_id)
def changeset_modified(self, repos, changeset, old_changeset): if self._is_duplicate(changeset): return current_tickets = self.parse_message(changeset.message) old_tickets = {} if old_changeset is not None: old_tickets = self.parse_message(old_changeset.message) tickets = dict(each for each in current_tickets.iteritems() if each[0] not in old_tickets) if self.ticket_comments: comment = self.make_ticket_comment(repos, changeset) self._update_tickets(tickets, changeset, comment, datetime.now(utc)) # Add rev to ticket changesets tkt_changesets = TicketChangesets(self.env) for tkt_id, cmds in tickets.iteritems(): tkt_changesets.add(tkt_id, repos.id, changeset.rev) # Remove rev from ticket changesets tickets = dict(each for each in old_tickets.iteritems() if each[0] not in current_tickets) for tkt_id, cmds in tickets.iteritems(): tkt_changesets.remove(tkt_id, repos.id, changeset.rev)