Mercurial > hg > mercurial-crew-with-dirclash
changeset 3636:bf3dec184c78
templater: remove cStringIO for fill
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 13 Nov 2006 13:26:57 -0600 |
parents | 231393b7316f |
children | 6a46c9ccc2ed |
files | mercurial/templater.py |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -204,11 +204,8 @@ def fill(text, width): yield text[start:m.start(0)], m.group(1) start = m.end(1) - fp = cStringIO.StringIO() - for para, rest in findparas(): - fp.write(space_re.sub(' ', textwrap.fill(para, width))) - fp.write(rest) - return fp.getvalue() + return "".join([space_re.sub(' ', textwrap.fill(para, width)) + rest + for para, rest in findparas()]) def firstline(text): '''return the first line of text'''