convert: inline strutil.rfindall()
This is the only place where strutil is used. I don't think it's worth to
keep the strutil module, so inline it.
Also, strutil.rfindall() appears to have off-by-one error. 'end = c - 1' is
wrong because 'end' is exclusive.
--- a/hgext/convert/subversion.py Wed Dec 14 12:07:23 2016 -0800
+++ b/hgext/convert/subversion.py Sun Oct 16 16:58:43 2016 +0900
@@ -14,7 +14,6 @@
error,
pycompat,
scmutil,
- strutil,
util,
)
@@ -1239,7 +1238,8 @@
for f in files:
if os.path.isdir(self.wjoin(f)):
dirs.add(f)
- for i in strutil.rfindall(f, '/'):
+ i = len(f)
+ for i in iter(lambda: f.rfind('/', 0, i), -1):
dirs.add(f[:i])
return dirs