changeset 18897 | 38982de2b4eb |
parent 18865 | 835e9dfd1e49 |
child 18898 | 856960173630 |
--- a/mercurial/scmutil.py Wed Apr 10 15:05:06 2013 -0700 +++ b/mercurial/scmutil.py Wed Apr 10 15:08:25 2013 -0700 @@ -890,3 +890,9 @@ del obj.__dict__[self.name] except KeyError: raise AttributeError(self.name) + +def finddirs(path): + pos = path.rfind('/') + while pos != -1: + yield path[:pos] + pos = path.rfind('/', 0, pos)