changeset 30610:c039eb03e652

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.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 16 Oct 2016 16:58:43 +0900
parents b654112a0119
children 65835b850a72
files hgext/convert/subversion.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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