Mercurial > public > mercurial-scm > hg-stable
diff mercurial/match.py @ 43571:c21aca51b392
utils: move the `dirs` definition in pathutil (API)
Before this change, the `dirs` class was accessible through the `mercurial.util`
module. That module is expected to stay free of scm specific content.
The `pathutil` destination has been selection by Martin von Zweigbergk.
This work is part of a refactoring to unify the revlog index and the nodemap.
This unification prepare the use of a persistent nodemap.
Differential Revision: https://phab.mercurial-scm.org/D7311
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Nov 2019 14:13:19 +0100 |
parents | 9f70512ae2cf |
children | ecd11c4d3834 |
line wrap: on
line diff
--- a/mercurial/match.py Wed Oct 23 12:15:42 2019 -0700 +++ b/mercurial/match.py Wed Nov 06 14:13:19 2019 +0100 @@ -18,6 +18,7 @@ encoding, error, pathutil, + pathutil, policy, pycompat, util, @@ -598,7 +599,7 @@ @propertycache def _dirs(self): - return set(util.dirs(self._fileset)) + return set(pathutil.dirs(self._fileset)) def visitdir(self, dir): dir = normalizerootdir(dir, b'visitdir') @@ -629,9 +630,9 @@ return b'<patternmatcher patterns=%r>' % pycompat.bytestr(self._pats) -# This is basically a reimplementation of util.dirs that stores the children -# instead of just a count of them, plus a small optional optimization to avoid -# some directories we don't need. +# This is basically a reimplementation of pathutil.dirs that stores the +# children instead of just a count of them, plus a small optional optimization +# to avoid some directories we don't need. class _dirchildren(object): def __init__(self, paths, onlyinclude=None): self._dirs = {} @@ -763,7 +764,7 @@ @propertycache def _dirs(self): - return set(util.dirs(self._fileset)) + return set(pathutil.dirs(self._fileset)) def visitdir(self, dir): dir = normalizerootdir(dir, b'visitdir') @@ -1510,8 +1511,8 @@ p = set() # Add the parents as non-recursive/exact directories, since they must be # scanned to get to either the roots or the other exact directories. - p.update(util.dirs(d)) - p.update(util.dirs(r)) + p.update(pathutil.dirs(d)) + p.update(pathutil.dirs(r)) # FIXME: all uses of this function convert these to sets, do so before # returning.