Skip to content
Snippets Groups Projects
Commit 8b7973d4 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

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
parent 878084a4
Branches
Tags
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment