[Zope3-checkins] CVS: Products3/z3checkins - message.py:1.18

Marius Gedminas marius at pov.lt
Wed Sep 17 10:01:49 EDT 2003


Update of /cvs-repository/Products3/z3checkins
In directory cvs.zope.org:/tmp/cvs-serv2301

Modified Files:
	message.py 
Log Message:
Better message formatting

=== Products3/z3checkins/message.py 1.17 => 1.18 ===
--- Products3/z3checkins/message.py:1.17	Wed Sep 17 09:34:44 2003
+++ Products3/z3checkins/message.py	Wed Sep 17 10:01:48 2003
@@ -204,7 +204,7 @@
             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)
@@ -227,6 +227,7 @@
                     or line.startswith("Added:")
                     or line.startswith("Modified:")
                     or line.startswith("Removed:")
+                    or line.startswith("Property changes on:")
                     or line == "Status:\n"
                     ):
                     break
@@ -592,6 +593,10 @@
             else:
                 status_idx = diff_idx
 
+            propchange_idx = text.find('\nProperty changes on:')
+            if propchange_idx != -1 and propchange_idx < status_idx:
+                status_idx = propchange_idx
+
         assert log_idx <= status_idx <= diff_idx <= sig_idx
 
         intro = text[:log_idx]
@@ -600,7 +605,17 @@
         diff = text[diff_idx:sig_idx]
         sig = text[sig_idx:]
 
-        log = '<p>%s</p>' % '</p><p>'.join(log.splitlines())
+        def empty2nbsp(s):
+            if not s:
+                return '&nbsp;'
+            n = 0
+            while n < len(s) and s[n] == ' ':
+                n += 1
+            if n:
+                return '&nbsp;' * n + s[n:]
+            else:
+                return s
+        log = '<p>%s</p>' % '</p>\n<p>'.join(map(empty2nbsp, log.splitlines()))
 
         if import_status is None:
             import_status = ''




More information about the Zope3-Checkins mailing list