[Zope3-checkins] CVS: zopeproducts/z3checkins - configure.zcml:1.10
interfaces.py:1.6 message.pt:1.6 message.py:1.15
Albertas Agejevas
alga at pov.lt
Tue Sep 9 19:17:04 EDT 2003
Update of /cvs-repository/zopeproducts/z3checkins
In directory cvs.zope.org:/tmp/cvs-serv17584
Modified Files:
configure.zcml interfaces.py message.pt message.py
Log Message:
Added support for messages generated by Subversion's commit-email.pl script.
Now ready for Subversion!
Made a marker interface ICheckinsFolder. It has to be applied on a folder
manually though.
=== zopeproducts/z3checkins/configure.zcml 1.9 => 1.10 ===
--- zopeproducts/z3checkins/configure.zcml:1.9 Sun Aug 3 14:36:08 2003
+++ zopeproducts/z3checkins/configure.zcml Tue Sep 9 18:16:33 2003
@@ -156,21 +156,21 @@
<!-- Browser views: containers -->
<browser:page
- for="zope.app.interfaces.container.IContainer"
+ for=".interfaces.ICheckinsFolder"
name="checkins.rss"
template="rss_container.pt"
class=".message.ContainerView"
permission="zope.View" />
<browser:page
- for="zope.app.interfaces.container.IContainer"
- name="checkins.html"
+ for=".interfaces.ICheckinsFolder"
+ name="index.html"
template="container.pt"
class=".message.ContainerView"
permission="zope.View" />
<browser:page
- for="zope.app.interfaces.container.IContainer"
+ for=".interfaces.ICheckinsFolder"
name="checkins-sidebar.html"
template="container.pt"
usage="sidebar"
=== zopeproducts/z3checkins/interfaces.py 1.5 => 1.6 ===
--- zopeproducts/z3checkins/interfaces.py:1.5 Fri Aug 1 05:43:16 2003
+++ zopeproducts/z3checkins/interfaces.py Tue Sep 9 18:16:33 2003
@@ -5,6 +5,7 @@
"""
from zope.interface import Interface, Attribute
+from zope.app.interfaces.content.folder import IFolder
class IMessage(Interface):
"""Mail message."""
@@ -49,6 +50,8 @@
May raise a FormatError if the message is ill-formed.
"""
+class ICheckinsFolder(IFolder):
+ """A marker interface for the checkins folder."""
class IMessageArchive(Interface):
"""A chronologically ordered sequence of messages.
=== zopeproducts/z3checkins/message.pt 1.5 => 1.6 ===
--- zopeproducts/z3checkins/message.pt:1.5 Fri Aug 1 05:43:16 2003
+++ zopeproducts/z3checkins/message.pt Tue Sep 9 18:16:33 2003
@@ -42,7 +42,7 @@
<div class="headers">
<p><span class="header">From:</span> <span class="value" tal:content="context/author" /></p>
<p><span class="header">Date:</span> <span class="value" tal:content="context/date/@@rfc822" /></p>
-<p><span class="header">Subject:</span> <span class="value" tal:content="string:[Zope3-checkins] CVS: ${context/subject}" /></p>
+<p><span class="header">Subject:</span> <span class="value" tal:content="context/subject" /></p>
</div>
<div class="body" tal:content="structure view/body" />
</body>
=== zopeproducts/z3checkins/message.py 1.14 => 1.15 ===
--- zopeproducts/z3checkins/message.py:1.14 Fri Aug 1 05:43:16 2003
+++ zopeproducts/z3checkins/message.py Tue Sep 9 18:16:33 2003
@@ -192,14 +192,20 @@
date = datetime(year, month, day, hours, minutes, seconds,
tzinfo=FixedTimezone(tzoffset / 60))
- if not subject.startswith(self._subject_prefix):
+ if (subject.startswith("Re:") or
+ subject.find("CVS:") == -1
+ and subject.find("rev ") == -1):
return Message(message_id=message_id, author=author,
author_name=author_name,
author_email=author_email, subject=subject,
date=date, full_text=full_text)
- subject = subject[len(self._subject_prefix):]
- directory = subject.split(' - ')[0]
+ if subject.find("CVS:") != -1:
+ subject = subject.split("CVS: ", 1)[1]
+ directory = subject.split(' - ')[0]
+ elif subject.find("rev ") != -1:
+ directory = subject.split(' - ')[1]
+
m.rewindbody()
body_lines = input.readlines()
log_message, branch = self.extract_log(body_lines)
@@ -218,12 +224,18 @@
in_log_msg = 0
for line in lines:
if in_log_msg:
- if line.startswith('=== ') or line == "Status:\n":
+ if (line.startswith('=== ')
+ or line.startswith("Added:")
+ or line.startswith("Modified:")
+ or line.startswith("Removed:")
+ or line == "Status:\n"
+ ):
break
else:
log_message.append(line)
else:
- if line.lower().startswith('log message:'):
+ if (line.lower().startswith('log message:') or
+ line.startswith("Log:")):
in_log_msg = 1
elif line.startswith(' Tag: '):
branch = line[len(' Tag: '):].strip()
@@ -487,9 +499,14 @@
log_idx = text.find('\nLog message:\n')
if log_idx == -1:
log_idx = text.find('\nLog Message:\n')
+ if log_idx != -1:
+ log_idx += len('\nLog message:\n')
+ if log_idx == -1:
+ log_idx = text.find('\nLog:\n')
+ if log_idx != -1:
+ log_idx += len('\nLog:\n')
if log_idx == -1:
return '<pre>%s</pre>' % text
- log_idx += len('\nLog message:\n')
sig_idx = text.rfind(
'\n_______________________________________________')
@@ -502,7 +519,11 @@
status_idx = text.find('\nStatus:\n')
if status_idx == -1:
- status_idx = diff_idx
+ if text[diff_idx:diff_idx+5] == "\n====":
+ # Subversion
+ status_idx = text.rfind('\n', 0, diff_idx)
+ else:
+ status_idx = diff_idx
assert log_idx <= status_idx <= diff_idx <= sig_idx
More information about the Zope3-Checkins
mailing list