This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8d730f96e792: patch: move yielding "\n" to the 
end of loop (authored by quark, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3210?vs=7922&id=8333

REVISION DETAIL
  https://phab.mercurial-scm.org/D3210

AFFECTED FILES
  mercurial/patch.py

CHANGE DETAILS

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2505,9 +2505,8 @@
         matches = {}
         if inlinecolor:
             matches = _findmatches(lines)
+        linecount = len(lines)
         for i, line in enumerate(lines):
-            if i != 0:
-                yield ('\n', '')
             if head:
                 if line.startswith('@'):
                     head = False
@@ -2546,6 +2545,8 @@
                 yield (line, '')
             if line != stripline:
                 yield (line[len(stripline):], 'diff.trailingwhitespace')
+            if i + 1 < linecount:
+                yield ('\n', '')
 
 def _findmatches(slist):
     '''Look for insertion matches to deletion and returns a dict of



To: quark, #hg-reviewers, durin42
Cc: yuja, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to