mercurial/mdiff.py
changeset 36146 29dd37a418aa
parent 35952 9e641c4525a2
child 36414 44c4a38bf563
--- 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