[PATCH 5 of 5] match: don't remove '.' from _includeroots
Martin von Zweigbergk
martinvonz at google.com
Mon Jun 15 17:13:54 UTC 2015
# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1432758168 25200
# Wed May 27 13:22:48 2015 -0700
# Node ID b7cc2780bf88ea6dc9ccf8d7e868211325e5d644
# Parent aeee4bc1da3e3aa6acb284d5da1a4cbef9e3d10b
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.
diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -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
More information about the Mercurial-devel
mailing list