# HG changeset patch # User Pierre-Yves David # Date 1489617482 25200 # Node ID 0e7a6279ff6eb4b8d19ded7672c49b35039235ae # Parent 55df8fa15b094361331058de93e18a565a494b4e context: simplify call to icase matcher in 'match()' The two function takes the very same arguments. We make this clearer and less error prone by dispatching on the function only and having a single call point in the code. diff -r 55df8fa15b09 -r 0e7a6279ff6e mercurial/context.py --- a/mercurial/context.py Thu Mar 16 09:13:13 2017 +0530 +++ b/mercurial/context.py Wed Mar 15 15:38:02 2017 -0700 @@ -1525,15 +1525,13 @@ # Only a case insensitive filesystem needs magic to translate user input # to actual case in the filesystem. + matcherfunc = matchmod.match if not util.fscasesensitive(r.root): - return matchmod.icasefsmatcher(r.root, r.getcwd(), pats, - include, exclude, default, r.auditor, - self, listsubrepos=listsubrepos, - badfn=badfn) - return matchmod.match(r.root, r.getcwd(), pats, - include, exclude, default, - auditor=r.auditor, ctx=self, - listsubrepos=listsubrepos, badfn=badfn) + matcherfunc = matchmod.icasefsmatcher + return matcherfunc(r.root, r.getcwd(), pats, + include, exclude, default, + auditor=r.auditor, ctx=self, + listsubrepos=listsubrepos, badfn=badfn) def _filtersuspectsymlink(self, files): if not files or self._repo.dirstate._checklink: