# HG changeset patch # User Yuya Nishihara # Date 1476604723 -32400 # Node ID c039eb03e652b27638e07f347edeafc06029b056 # Parent b654112a011940c4cd611e79d62480bd34b284b2 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. diff -r b654112a0119 -r c039eb03e652 hgext/convert/subversion.py --- 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