diff --git a/contrib/hgdiff b/contrib/hgdiff --- a/contrib/hgdiff +++ b/contrib/hgdiff @@ -38,13 +38,13 @@ def buildlist(names, top): def diff_files(file1, file2): if file1 is None: - b = file(file2).read().splitlines(1) + b = file(file2).read().splitlines(True) l1 = "--- %s\n" % (file2) l2 = "+++ %s\n" % (file2) l3 = "@@ -0,0 +1,%d @@\n" % len(b) l = [l1, l2, l3] + ["+" + e for e in b] elif file2 is None: - a = file(file1).read().splitlines(1) + a = file(file1).read().splitlines(True) l1 = "--- %s\n" % (file1) l2 = "+++ %s\n" % (file1) l3 = "@@ -1,%d +0,0 @@\n" % len(a) @@ -52,8 +52,8 @@ def diff_files(file1, file2): else: t1 = file(file1).read() t2 = file(file2).read() - l1 = t1.splitlines(1) - l2 = t2.splitlines(1) + l1 = t1.splitlines(True) + l2 = t2.splitlines(True) if options.difflib: l = difflib.unified_diff(l1, l2, file1, file2) else: diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -183,7 +183,7 @@ class mercurial_sink(converter_sink): tagparent = nullid try: - oldlines = sorted(parentctx['.hgtags'].data().splitlines(1)) + oldlines = sorted(parentctx['.hgtags'].data().splitlines(True)) except: oldlines = [] diff --git a/hgext/hgcia.py b/hgext/hgcia.py --- a/hgext/hgcia.py +++ b/hgext/hgcia.py @@ -205,7 +205,7 @@ class hgcia(object): msg['From'] = self.emailfrom msg['Subject'] = 'DeliverXML' msg['Content-type'] = 'text/xml' - msgtext = msg.as_string(0) + msgtext = msg.as_string() self.ui.status(_('hgcia: sending update to %s\n') % address) mail.sendmail(self.ui, util.email(self.emailfrom), diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -221,7 +221,7 @@ class notifier(object): hash(self.repo.root), socket.getfqdn())) msg['To'] = ', '.join(self.subs) - msgtext = msg.as_string(0) + msgtext = msg.as_string() if self.test: self.ui.write(msgtext) if not msgtext.endswith('\n'): diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1448,7 +1448,7 @@ def help_(ui, name=None, with_version=Fa if not doc: doc = _("(no help text available)") if ui.quiet: - doc = doc.splitlines(0)[0] + doc = doc.splitlines()[0] ui.write("\n%s\n" % doc.rstrip()) if not ui.quiet: @@ -1476,7 +1476,7 @@ def help_(ui, name=None, with_version=Fa doc = gettext(e[0].__doc__) if not doc: doc = _("(no help text available)") - h[f] = doc.splitlines(0)[0].rstrip() + h[f] = doc.splitlines()[0].rstrip() cmds[f] = c.lstrip("^") if not h: @@ -1523,7 +1523,7 @@ def help_(ui, name=None, with_version=Fa raise error.UnknownCommand(name) doc = gettext(mod.__doc__) or _('no help text available') - doc = doc.splitlines(0) + doc = doc.splitlines() ui.write(_('%s extension - %s\n') % (name.split('.')[-1], doc[0])) for d in doc[1:]: ui.write(d, '\n') diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -82,7 +82,7 @@ class config(object): line = 0 cont = 0 - for l in data.splitlines(1): + for l in data.splitlines(True): line += 1 if cont: m = contre.match(l) diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -443,7 +443,7 @@ class filectx(object): del hist[p] hist[f] = curr - return zip(hist[f][0], hist[f][1].splitlines(1)) + return zip(hist[f][0], hist[f][1].splitlines(True)) def ancestor(self, fc2): """ diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -173,6 +173,6 @@ def enabled(): doc = (gettext(ext.__doc__) or _('(no help text available)')) ename = ename.split('.')[-1] maxlength = max(len(ename), maxlength) - exts[ename] = doc.splitlines(0)[0].strip() + exts[ename] = doc.splitlines()[0].strip() return exts, maxlength diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -65,7 +65,7 @@ def _filerevision(web, tmpl, fctx): text = '(binary:%s)' % mt def lines(): - for lineno, t in enumerate(text.splitlines(1)): + for lineno, t in enumerate(text.splitlines(True)): yield {"line": t, "lineid": "l%d" % (lineno + 1), "linenumber": "% 6d" % (lineno + 1), diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -73,7 +73,7 @@ def fill(text, width): def firstline(text): '''return the first line of text''' try: - return text.splitlines(1)[0].rstrip('\r\n') + return text.splitlines(True)[0].rstrip('\r\n') except IndexError: return ''