mercurial/mdiff.py
branchstable
changeset 15509 3774e1453ef4
parent 15462 2b1ec74c961f
child 15513 646759147717
--- a/mercurial/mdiff.py	Sat Nov 12 14:00:25 2011 +0100
+++ b/mercurial/mdiff.py	Sun Nov 13 21:37:14 2011 +0100
@@ -72,7 +72,7 @@
         text = re.sub('[ \t\r]+', ' ', text)
         text = text.replace(' \n', '\n')
     if blank and opts.ignoreblanklines:
-        text = re.sub('\n+', '', text)
+        text = re.sub('\n+', '\n', text).strip('\n')
     return text
 
 def diffline(revs, a, b, opts):