--- a/mercurial/match.py Fri May 29 14:24:50 2015 -0700
+++ b/mercurial/match.py Wed May 27 10:44:04 2015 -0700
@@ -129,8 +129,9 @@
kindpats = self._normalize(exclude, 'glob', root, cwd, auditor)
self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)',
listsubrepos, root)
- self._excluderoots.update(_roots(kindpats))
- self._excluderoots.discard('.')
+ if not _anypats(kindpats):
+ self._excluderoots.update(_roots(kindpats))
+ self._excluderoots.discard('.')
matchfns.append(lambda f: not em(f))
if exact:
if isinstance(patterns, list):