match: drop support for passing '.' for root dir to visit*() methods
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 29 Oct 2019 23:33:34 -0700
changeset 43595 ecd11c4d3834
parent 43594 ac140b85aae9
child 43596 0ad5d6c4bfad
match: drop support for passing '.' for root dir to visit*() methods We said we'd drop support for it after 5.1, so it's time to clean it up now. Differential Revision: https://phab.mercurial-scm.org/D7249
mercurial/match.py
--- a/mercurial/match.py	Wed Oct 16 21:31:40 2019 -0700
+++ b/mercurial/match.py	Tue Oct 29 23:33:34 2019 -0700
@@ -547,16 +547,6 @@
         return b'<predicatenmatcher pred=%s>' % s
 
 
-def normalizerootdir(dir, funcname):
-    if dir == b'.':
-        util.nouideprecwarn(
-            b"match.%s() no longer accepts '.', use '' instead." % funcname,
-            b'5.1',
-        )
-        return b''
-    return dir
-
-
 class patternmatcher(basematcher):
     """Matches a set of (kind, pat, source) against a 'root' directory.
 
@@ -602,7 +592,6 @@
         return set(pathutil.dirs(self._fileset))
 
     def visitdir(self, dir):
-        dir = normalizerootdir(dir, b'visitdir')
         if self._prefix and dir in self._fileset:
             return b'all'
         return (
@@ -686,7 +675,6 @@
         self._parents = parents
 
     def visitdir(self, dir):
-        dir = normalizerootdir(dir, b'visitdir')
         if self._prefix and dir in self._roots:
             return b'all'
         return (
@@ -767,12 +755,9 @@
         return set(pathutil.dirs(self._fileset))
 
     def visitdir(self, dir):
-        dir = normalizerootdir(dir, b'visitdir')
         return dir in self._dirs
 
     def visitchildrenset(self, dir):
-        dir = normalizerootdir(dir, b'visitchildrenset')
-
         if not self._fileset or dir not in self._dirs:
             return set()
 
@@ -1009,7 +994,6 @@
         return self._matcher.matchfn(self._path + b"/" + f)
 
     def visitdir(self, dir):
-        dir = normalizerootdir(dir, b'visitdir')
         if dir == b'':
             dir = self._path
         else:
@@ -1017,7 +1001,6 @@
         return self._matcher.visitdir(dir)
 
     def visitchildrenset(self, dir):
-        dir = normalizerootdir(dir, b'visitchildrenset')
         if dir == b'':
             dir = self._path
         else: