mercurial/mdiff.py
changeset 34013 da07367d683b
parent 33102 1b6946f87c50
child 34506 1d804c22c671
--- a/mercurial/mdiff.py	Fri Aug 25 11:20:34 2017 -0700
+++ b/mercurial/mdiff.py	Tue Aug 29 18:20:50 2017 -0700
@@ -63,6 +63,7 @@
         'index': 0,
         'ignorews': False,
         'ignorewsamount': False,
+        'ignorewseol': False,
         'ignoreblanklines': False,
         'upgrade': False,
         'showsimilarity': False,
@@ -97,6 +98,8 @@
         text = bdiff.fixws(text, 0)
     if blank and opts.ignoreblanklines:
         text = re.sub('\n+', '\n', text).strip('\n')
+    if opts.ignorewseol:
+        text = re.sub(r'[ \t\r\f]+\n', r'\n', text)
     return text
 
 def splitblock(base1, lines1, base2, lines2, opts):
@@ -199,7 +202,7 @@
     """
     if opts is None:
         opts = defaultopts
-    if opts.ignorews or opts.ignorewsamount:
+    if opts.ignorews or opts.ignorewsamount or opts.ignorewseol:
         text1 = wsclean(opts, text1, False)
         text2 = wsclean(opts, text2, False)
     diff = bdiff.blocks(text1, text2)