diff mercurial/util.py @ 43633:0b7733719d21

utils: move finddirs() to pathutil This is a follow-up to c21aca51b392 (utils: move the `dirs` definition in pathutil (API), 2019-11-06). finddirs() is closely related to dirs and used by it. Differential Revision: https://phab.mercurial-scm.org/D7388
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 08:03:26 -0800
parents c21aca51b392
children 38387f9e4d22
line wrap: on
line diff
--- a/mercurial/util.py	Wed Nov 13 21:52:25 2019 -0500
+++ b/mercurial/util.py	Thu Nov 14 08:03:26 2019 -0800
@@ -3491,14 +3491,6 @@
     f.flush()
 
 
-def finddirs(path):
-    pos = path.rfind(b'/')
-    while pos != -1:
-        yield path[:pos]
-        pos = path.rfind(b'/', 0, pos)
-    yield b''
-
-
 # convenient shortcut
 dst = debugstacktrace