Mercurial > public > mercurial-scm > hg-stable
diff mercurial/strutil.py @ 7073:af1117f37fa7
convert: tolerate embedded spaces in filemap source revisions
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 10 Oct 2008 11:32:38 +0200 |
parents | 3d5547845158 |
children | 380fda3eed13 |
line wrap: on
line diff
--- a/mercurial/strutil.py Fri Oct 03 23:13:03 2008 +0200 +++ b/mercurial/strutil.py Fri Oct 10 11:32:38 2008 +0200 @@ -32,3 +32,10 @@ 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]]