diff mercurial/context.py @ 32395:24245b54aa8a

match: replace match class by match function (API) The matcher class is getting hard to understand. It will be easier to follow if we can break it up into simpler matchers that we then compose. I'm hoping to have one matcher that accepts regular (non-include) patterns, one for exact file matches, one that always matches (and maybe one that never does) and then compose them by intersection and difference. This patch takes a simple but important step towards that goal by making match.match() a function (and renaming the matcher class itself from "match" to "matcher"). The new function will eventually be responsible for creating the simple matchers and composing them. icasefsmatcher similarly gets a factory function (called "icasefsmatch"). I also moved the other factory functions nearby.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 12 May 2017 23:11:41 -0700
parents 81936f6462c1
children 284b18303f61
line wrap: on
line diff
--- a/mercurial/context.py	Sun May 21 18:36:28 2017 -0400
+++ b/mercurial/context.py	Fri May 12 23:11:41 2017 -0700
@@ -1595,7 +1595,7 @@
         # to actual case in the filesystem.
         matcherfunc = matchmod.match
         if not util.fscasesensitive(r.root):
-            matcherfunc = matchmod.icasefsmatcher
+            matcherfunc = matchmod.icasefsmatch
         return matcherfunc(r.root, r.getcwd(), pats,
                            include, exclude, default,
                            auditor=r.auditor, ctx=self,