Mercurial > hg
changeset 41269:8b7973d40a01
bdiff: drop duplicate definition of splitnewlines()
It was added in 29dd37a418aa (bdiff: write a native version of
splitnewlines, 2018-01-25).
Differential Revision: https://phab.mercurial-scm.org/D5618
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 16 Jan 2019 16:55:52 -0800 |
parents | 878084a495ef |
children | 188880a3e87b |
files | mercurial/pure/bdiff.py |
diffstat | 1 files changed, 0 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/pure/bdiff.py Wed Jan 16 21:54:16 2019 -0500 +++ b/mercurial/pure/bdiff.py Wed Jan 16 16:55:52 2019 -0800 @@ -90,13 +90,3 @@ text = re.sub('[ \t\r]+', ' ', text) text = text.replace(' \n', '\n') return text - -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