Mercurial > hg
changeset 8155:b7cdfa2527be
strutil: removed rsplit
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Fri, 24 Apr 2009 17:32:18 +0200 |
parents | 06f1e4e309ed |
children | 9fd0822c2ec3 |
files | hgext/convert/common.py hgext/convert/subversion.py mercurial/strutil.py |
diffstat | 3 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/common.py Fri Apr 24 17:32:18 2009 +0200 +++ b/hgext/convert/common.py Fri Apr 24 17:32:18 2009 +0200 @@ -335,7 +335,7 @@ return for i, line in enumerate(fp): try: - key, value = strutil.rsplit(line[:-1], ' ', 1) + key, value = line[:-1].rsplit(' ', 1) except ValueError: raise util.Abort(_('syntax error in %s(%d): key/value pair expected') % (self.path, i+1))
--- a/hgext/convert/subversion.py Fri Apr 24 17:32:18 2009 +0200 +++ b/hgext/convert/subversion.py Fri Apr 24 17:32:18 2009 +0200 @@ -501,7 +501,7 @@ return int(rev.split('@')[-1]) def revsplit(self, rev): - url, revnum = strutil.rsplit(rev.encode(self.encoding), '@', 1) + url, revnum = rev.encode(self.encoding).rsplit('@', 1) revnum = int(revnum) parts = url.split('/', 1) uuid = parts.pop(0)[4:]
--- a/mercurial/strutil.py Fri Apr 24 17:32:18 2009 +0200 +++ b/mercurial/strutil.py Fri Apr 24 17:32:18 2009 +0200 @@ -32,10 +32,3 @@ break yield c end = c - 1 - -def rsplit(s, sep=None, maxsplit=-1): - try: - return s.rsplit(sep, maxsplit) - except AttributeError: - return [chunk[::-1] for chunk in - s[::-1].split(sep, maxsplit)[::-1]]