Mercurial > hg
comparison mercurial/match.py @ 25575:475eae3497af
match: drop unnecessary removal of '.' from excluded roots
The repo root is nothing special when it comes to what directories to
visit: patterns like '-X relglob:*.py' should not exclude the top
directory, while '-X path:.' should (pointless as such a pattern may
be). The explicit removal of '.' from the set of excluded roots was
probably there to avoid removing the the root directory when any
patterns had been given, but since 20ad936ac5d2 (treemanifest: visit
directory 'foo' when given e.g. '-X foo/ba?', 2015-05-27), we only
exclude directories that should be completely excluded, so we no
longer need to special-case the root directory.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 27 May 2015 13:23:35 -0700 |
parents | 504a1f295677 |
children | d02f4b3e71f5 |
comparison
equal
deleted
inserted
replaced
25574:88a17ccf0196 | 25575:475eae3497af |
---|---|
133 kindpats = self._normalize(exclude, 'glob', root, cwd, auditor) | 133 kindpats = self._normalize(exclude, 'glob', root, cwd, auditor) |
134 self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)', | 134 self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)', |
135 listsubrepos, root) | 135 listsubrepos, root) |
136 if not _anypats(kindpats): | 136 if not _anypats(kindpats): |
137 self._excluderoots.update(_roots(kindpats)) | 137 self._excluderoots.update(_roots(kindpats)) |
138 self._excluderoots.discard('.') | |
139 matchfns.append(lambda f: not em(f)) | 138 matchfns.append(lambda f: not em(f)) |
140 if exact: | 139 if exact: |
141 if isinstance(patterns, list): | 140 if isinstance(patterns, list): |
142 self._files = patterns | 141 self._files = patterns |
143 else: | 142 else: |