Mercurial > hg
diff contrib/hgdiff @ 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 | f9a80054dd3c |
children |
line wrap: on
line diff
--- a/contrib/hgdiff Tue Jul 14 20:24:16 2009 +0200 +++ b/contrib/hgdiff Mon Jul 13 09:50:26 2009 +0900 @@ -38,13 +38,13 @@ def diff_files(file1, file2): if file1 is None: - b = file(file2).read().splitlines(1) + b = file(file2).read().splitlines(True) l1 = "--- %s\n" % (file2) l2 = "+++ %s\n" % (file2) l3 = "@@ -0,0 +1,%d @@\n" % len(b) l = [l1, l2, l3] + ["+" + e for e in b] elif file2 is None: - a = file(file1).read().splitlines(1) + a = file(file1).read().splitlines(True) l1 = "--- %s\n" % (file1) l2 = "+++ %s\n" % (file1) l3 = "@@ -1,%d +0,0 @@\n" % len(a) @@ -52,8 +52,8 @@ else: t1 = file(file1).read() t2 = file(file2).read() - l1 = t1.splitlines(1) - l2 = t2.splitlines(1) + l1 = t1.splitlines(True) + l2 = t2.splitlines(True) if options.difflib: l = difflib.unified_diff(l1, l2, file1, file2) else: