diff -r 15175774e1c5 -r 7623d79f872c mercurial/pathutil.py --- a/mercurial/pathutil.py Mon Jan 16 12:10:20 2023 +0000 +++ b/mercurial/pathutil.py Fri Jan 06 17:29:42 2023 +0000 @@ -314,6 +314,13 @@ yield b'' +def finddirs_rev_noroot(path: bytes) -> Iterator[bytes]: + pos = path.find(pycompat.ossep) + while pos != -1: + yield path[:pos] + pos = path.find(pycompat.ossep, pos + 1) + + class dirs: '''a multiset of directory names from a set of file paths'''