D5618: bdiff: drop duplicate definition of splitnewlines()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jan 17 05:21:18 EST 2019


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

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



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


More information about the Mercurial-devel mailing list