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
yuja added a comment.
`rawline` can be removed after the rewrite of +/- lines handling.
-for rawline in mdiff.splitnewlines(chunk):
-line = rawline.rstrip('\n')
+for line in mdiff.splitnewlines(chunk):
if head:
if
quark added a comment.
I thought it was `for line in mdiff.splitnewlines(...)`. If we have both
`rawline` and `line` variables, then it is easier.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3210
To: quark, #hg-reviewers
Cc: yuja, mercurial-devel
___
yuja added a comment.
It's just a few-line patch after removal of the current worddiff, and can be
simplified further.
Anyway, I can clean up later.
diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2490,10 +2490
quark added a comment.
That's ideal. But a lot of code in this area expects "line" to not contain
"\n". So the change won't be as easy as it looks.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3210
To: quark, #hg-reviewers
Cc: yuja, mercurial-devel
__
yuja added a comment.
Perhaps, it's simpler to use `mdiff.splitnewlines(chunk)` instead of
`chunk.split('\n')`
because otherwise the next patch has to reconstruct `line + '\n'`.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3210
To: quark, #hg-reviewers
Cc:
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The original logic makes it harder to reason about - it yields the "\n"
character belonging to the last line in the next loop iteration.
The new code is in theo