Patchwork D151: match: override visitdir() in nevermatcher to return False

login
register
mail settings
Submitter phabricator
Date July 25, 2017, 5:21 p.m.
Message ID <9085b4e9b023f8ae1bbb22e2adb3658c@localhost.localdomain>
Download mbox | patch
Permalink /patch/22554/
State Not Applicable
Headers show

Comments

phabricator - July 25, 2017, 5:21 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG44bc181b9835: match: override visitdir() in nevermatcher to return False (authored by martinvonz).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D151?vs=320&id=401#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D151?vs=320&id=401

REVISION DETAIL
  https://phab.mercurial-scm.org/D151

AFFECTED FILES
  mercurial/match.py
  tests/test-match.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, durham, durin42
Cc: durin42, durham, mercurial-devel

Patch

diff --git a/tests/test-match.py b/tests/test-match.py
new file mode 100644
--- /dev/null
+++ b/tests/test-match.py
@@ -0,0 +1,19 @@ 
+from __future__ import absolute_import
+
+import unittest
+
+import silenttestrunner
+
+from mercurial import (
+    match as matchmod,
+)
+
+class NeverMatcherTests(unittest.TestCase):
+
+    def testVisitdir(self):
+        m = matchmod.nevermatcher('', '')
+        self.assertFalse(m.visitdir('.'))
+        self.assertFalse(m.visitdir('dir'))
+
+if __name__ == '__main__':
+    silenttestrunner.main(__name__)
diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -363,6 +363,9 @@ 
     def prefix(self):
         return True
 
+    def visitdir(self, dir):
+        return False
+
     def __repr__(self):
         return '<nevermatcher>'