+# -*- coding: utf-8 -*-
+
from trac.core import *
from trac.ticket import ITicketChangeListener
import subprocess
+import re
import textwrap
import shlex
+quoted_re = re.compile('^(?:> ?\n)*> .+\n(?:>(?: .*)?\n)*', re.MULTILINE)
+
class ZephyrPlugin(Component):
implements(ITicketChangeListener)
p.wait()
def format_text(self, text):
+ text = re.sub(quoted_re, u'> […]\n', text)
lines = textwrap.fill(text).split('\n')
if len(lines) > 5:
lines = lines[:5] + [u'[…]']
self.zwrite(ticket.id, message)
def ticket_changed(self, ticket, comment, author, old_values):
- message = ''
+ message = "(%s)\n" % ticket['summary']
for field in ticket.fields:
name = field['name']
if name not in old_values: