bdiff: drop duplicate definition of splitnewlines()
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 16 Jan 2019 16:55:52 -0800
changeset 41269 8b7973d40a01
parent 41268 878084a495ef
child 41270 188880a3e87b
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
mercurial/pure/bdiff.py
--- 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