changeset 35:9197c26a414b

unidiff: punt on comparing empty files
author mpm@selenic.com
date Sat, 07 May 2005 16:10:50 -0800
parents 8708c75da2ac
children da28286bf6b7
files mercurial/mdiff.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mdiff.py	Sat May 07 11:37:28 2005 -0800
+++ b/mercurial/mdiff.py	Sat May 07 16:10:50 2005 -0800
@@ -3,9 +3,10 @@
 from cStringIO import StringIO
 
 def unidiff(a, b, fn):
+    if not a and not b: return ""
     a = a.splitlines(1)
     b = b.splitlines(1)
-    l = difflib.unified_diff(a, b, fn, fn)
+    l = list(difflib.unified_diff(a, b, fn, fn))
     return "".join(l)
 
 def textdiff(a, b):