[PATCH 1 of 1] mdiff: cr and ff are also ignorable whitespace (issue2291)

Mads Kiilerich mads at kiilerich.com
Wed Oct 6 09:09:35 CDT 2010


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1286374043 -7200
# Node ID d8c0795bc96880a1beee0c1ab28feb31a8556f71
# Parent  bc1f749c1e2341189e45c782e0357af8ef5f8a64
mdiff: cr and ff are also ignorable whitespace (issue2291)

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -67,10 +67,10 @@
 
 def wsclean(opts, text, blank=True):
     if opts.ignorews:
-        text = re.sub('[ \t]+', '', text)
+        text = re.sub('[ \t\f\r]+', '', text)
     elif opts.ignorewsamount:
-        text = re.sub('[ \t]+', ' ', text)
-        text = re.sub('[ \t]+\n', '\n', text)
+        text = re.sub('[ \t\f\r]+', ' ', text)
+        text = re.sub('[ \t\f\r]+\n', '\n', text)
     if blank and opts.ignoreblanklines:
         text = re.sub('\n+', '', text)
     return text


More information about the Mercurial-devel mailing list