Patchwork D5618: bdiff: drop duplicate definition of splitnewlines()

login
register
mail settings
Submitter phabricator
Date Jan. 17, 2019, 10:21 a.m.
Message ID <c317b8565b81c2d4499ef8151e4d949d@localhost.localdomain>
Download mbox | patch
Permalink /patch/37856/
State Not Applicable
Headers show

Comments

phabricator - Jan. 17, 2019, 10:21 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8b7973d40a01: bdiff: drop duplicate definition of splitnewlines() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5618?vs=13301&id=13311

REVISION DETAIL
  https://phab.mercurial-scm.org/D5618

AFFECTED FILES
  mercurial/pure/bdiff.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
--- a/mercurial/pure/bdiff.py
+++ b/mercurial/pure/bdiff.py
@@ -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