mercurial/mdiff.py
changeset 12751 8eb758ea738c
parent 12025 2315a95ee887
child 15141 16dc9a32ca04
--- a/mercurial/mdiff.py	Fri Oct 15 23:00:45 2010 -0500
+++ b/mercurial/mdiff.py	Tue Oct 19 03:55:06 2010 +0200
@@ -67,10 +67,10 @@
 
 def wsclean(opts, text, blank=True):
     if opts.ignorews:
-        text = re.sub('[ \t]+', '', text)
+        text = re.sub('[ \t\r]+', '', text)
     elif opts.ignorewsamount:
-        text = re.sub('[ \t]+', ' ', text)
-        text = re.sub('[ \t]+\n', '\n', text)
+        text = re.sub('[ \t\r]+', ' ', text)
+        text = text.replace(' \n', '\n')
     if blank and opts.ignoreblanklines:
         text = re.sub('\n+', '', text)
     return text