D4160: match: add missing "return set()", add FIXME to test to doc a bug

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Thu Aug 9 00:08:53 UTC 2018


spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  These were both brought up during the codereview of https://phab.mercurial-scm.org/D4130.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS

diff --git a/tests/test-match.py b/tests/test-match.py
--- a/tests/test-match.py
+++ b/tests/test-match.py
@@ -97,6 +97,8 @@
         self.assertEqual(m.visitchildrenset('.'), 'this')
         self.assertEqual(m.visitchildrenset('dir/subdir/x'), set())
         self.assertEqual(m.visitchildrenset('folder'), set())
+        # FIXME: These should probably be {'subdir'} and 'this', respectively,
+        # or at least 'this' and 'this'.
         self.assertEqual(m.visitchildrenset('dir'), set())
         self.assertEqual(m.visitchildrenset('dir/subdir'), set())
 
diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -910,6 +910,7 @@
             return self._matcher.visitchildrenset(dir[len(self._pathprefix):])
         if dir in self._pathdirs:
             return 'this'
+        return set()
 
     def isexact(self):
         return self._matcher.isexact()



To: spectral, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list