Mercurial > public > mercurial-scm > hg
comparison mercurial/templatefilters.py @ 9136:31177742f54a
for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Mon, 13 Jul 2009 09:50:26 +0900 |
parents | 0001e49f1c11 |
children | 20ed9909dbd9 |
comparison
equal
deleted
inserted
replaced
9135:df881932362f | 9136:31177742f54a |
---|---|
71 for para, rest in findparas()]) | 71 for para, rest in findparas()]) |
72 | 72 |
73 def firstline(text): | 73 def firstline(text): |
74 '''return the first line of text''' | 74 '''return the first line of text''' |
75 try: | 75 try: |
76 return text.splitlines(1)[0].rstrip('\r\n') | 76 return text.splitlines(True)[0].rstrip('\r\n') |
77 except IndexError: | 77 except IndexError: |
78 return '' | 78 return '' |
79 | 79 |
80 def nl2br(text): | 80 def nl2br(text): |
81 '''replace raw newlines with xhtml line breaks.''' | 81 '''replace raw newlines with xhtml line breaks.''' |