Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 38613:760cc5dc01e8
fileset: restrict getfileset() to not return a computed set (API)
And rename the functions accordingly. fileset.match() will be changed to
not compute the initial subset.
test-glog*.t get back to the state before 9f9ffe5f687c "match: compose
'set:' pattern as matcher."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 09 Jun 2018 20:53:12 +0900 |
parents | 3a7c33a2cc5e |
children | 41ac8ea1bdd7 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Sat Jun 09 22:04:07 2018 +0900 +++ b/mercurial/subrepo.py Sat Jun 09 20:53:12 2018 +0900 @@ -318,9 +318,9 @@ """return file flags""" return '' - def getfileset(self, expr): + def matchfileset(self, expr, badfn=None): """Resolve the fileset expression for this repo""" - return set() + return matchmod.nevermatcher(self.wvfs.base, '', badfn=badfn) def printfiles(self, ui, m, fm, fmt, subrepos): """handle the files command for this subrepo""" @@ -792,24 +792,30 @@ return cmdutil.files(ui, ctx, m, fm, fmt, subrepos) @annotatesubrepoerror - def getfileset(self, expr): + def matchfileset(self, expr, badfn=None): + repo = self._repo if self._ctx.rev() is None: - ctx = self._repo[None] + ctx = repo[None] else: rev = self._state[1] - ctx = self._repo[rev] + ctx = repo[rev] - files = ctx.getfileset(expr) + matchers = [ctx.matchfileset(expr, badfn=badfn)] for subpath in ctx.substate: sub = ctx.sub(subpath) try: - files.extend(subpath + '/' + f for f in sub.getfileset(expr)) + sm = sub.matchfileset(expr, badfn=badfn) + pm = matchmod.prefixdirmatcher(repo.root, repo.getcwd(), + subpath, sm, badfn=badfn) + matchers.append(pm) except error.LookupError: self.ui.status(_("skipping missing subrepository: %s\n") % self.wvfs.reljoin(reporelpath(self), subpath)) - return files + if len(matchers) == 1: + return matchers[0] + return matchmod.unionmatcher(matchers) def walk(self, match): ctx = self._repo[None]