D3210: patch: move yielding "\n" to the end of loop
quark (Jun Wu)
phabricator at mercurial-scm.org
Mon Apr 16 19:12:07 EDT 2018
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
More information about the Mercurial-devel
mailing list