match: don't remove '.' from _includeroots
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 27 May 2015 13:22:48 -0700
changeset 25579 b76410eed482
parent 25578 4b1ec70b9713
child 25580 a69983942fb4
match: don't remove '.' from _includeroots This makes _includeroots more like _fileroots and gives visitdir() a nice symmetry in the two. I'm hoping to later combine the two (_fileroots and _includeroots), and having them treated similarly should make that step easier to follow.
mercurial/match.py
--- a/mercurial/match.py	Sun May 31 13:17:41 2015 -0700
+++ b/mercurial/match.py	Wed May 27 13:22:48 2015 -0700
@@ -126,7 +126,6 @@
             self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)',
                                               listsubrepos, root)
             self._includeroots.update(_roots(kindpats))
-            self._includeroots.discard('.')
             self._includedirs.update(util.dirs(self._includeroots))
             matchfns.append(im)
         if exclude:
@@ -225,6 +224,7 @@
         if dir in self._excluderoots:
             return False
         if (self._includeroots and
+            '.' not in self._includeroots and
             dir not in self._includeroots and
             dir not in self._includedirs and
             not any(parent in self._includeroots