diff -r 4f3e989536c3 -r 29dd37a418aa mercurial/mdiff.py --- a/mercurial/mdiff.py Mon Feb 12 16:09:31 2018 +0100 +++ b/mercurial/mdiff.py Thu Jan 25 21:16:28 2018 -0500 @@ -29,16 +29,7 @@ patches = mpatch.patches patchedsize = mpatch.patchedsize textdiff = bdiff.bdiff - -def splitnewlines(text): - '''like str.splitlines, but only split on newlines.''' - lines = [l + '\n' for l in text.split('\n')] - if lines: - if lines[-1] == '\n': - lines.pop() - else: - lines[-1] = lines[-1][:-1] - return lines +splitnewlines = bdiff.splitnewlines class diffopts(object): '''context is the number of context lines