Skip to content

Commit 7336b30

Browse files
author
Richard Jones
committed
fix email change note rendering of multiline properties (patch [SF#1575223])
1 parent 8688427 commit 7336b30

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Fixed:
1313
- roundup-server called setuid when run by non-root user
1414
- fix sort/group direction checkbox in issue.index.html (sf bug 1593025)
1515
- fix error detection for non-EN locales of postgres (sf bug 1592249)
16+
- fix email change note rendering of multiline properties (sf patch 1575223)
1617

1718

1819
2006-10-07 1.2.1

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Roch'e Compaan,
8181
Wil Cooley,
8282
Joe Cooper,
8383
Kelley Dagley,
84+
Toby Dickenson,
8485
Paul F. Dubois,
8586
Eric Earnst,
8687
Andrew Eland,

roundup/roundupdb.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundupdb.py,v 1.125 2006-09-09 05:50:17 richard Exp $
19+
# $Id: roundupdb.py,v 1.126 2006-11-09 01:13:56 richard Exp $
2020

2121
"""Extending hyperdb with types specific to issue-tracking.
2222
"""
@@ -496,6 +496,10 @@ def generateCreateNote(self, nodeid):
496496
value = [link.get(entry, key) for entry in value]
497497
value.sort()
498498
value = ', '.join(value)
499+
else:
500+
value = str(value)
501+
if '\n' in value:
502+
value = '\n'+self.indentChangeNoteValue(value)
499503
m.append('%s: %s'%(propname, value))
500504
m.insert(0, '----------')
501505
m.insert(0, '')
@@ -587,10 +591,19 @@ def generateChangeNote(self, nodeid, oldvalues):
587591
change += ' -%s'%(', '.join(l))
588592
else:
589593
change = '%s -> %s'%(oldvalue, value)
594+
if '\n' in change:
595+
value = self.indentChangeNoteValue(str(value))
596+
oldvalue = self.indentChangeNoteValue(str(oldvalue))
597+
change = '\nNow:\n%s\nWas:\n%s'%(value, oldvalue)
590598
m.append('%s: %s'%(propname, change))
591599
if m:
592600
m.insert(0, '----------')
593601
m.insert(0, '')
594602
return '\n'.join(m)
595603

604+
def indentChangeNoteValue(self, text):
605+
lines = text.rstrip('\n').split('\n')
606+
lines = [ ' '+line for line in lines ]
607+
return '\n'.join(lines)
608+
596609
# vim: set filetype=python sts=4 sw=4 et si :

0 commit comments

Comments
 (0)