Mercurial > public > mercurial-scm > hg-stable
diff mercurial/scmutil.py @ 18897:38982de2b4eb
scmutil: migrate finddirs from dirstate
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Wed, 10 Apr 2013 15:08:25 -0700 |
parents | 835e9dfd1e49 |
children | 856960173630 |
line wrap: on
line diff
--- 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)