comparison mercurial/context.py @ 31464:0e7a6279ff6e

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 15 Mar 2017 15:38:02 -0700
parents 084050d76e4f
children 413b44003462
comparison
equal deleted inserted replaced
31463:55df8fa15b09 31464:0e7a6279ff6e
1523 pats = [] 1523 pats = []
1524 r = self._repo 1524 r = self._repo
1525 1525
1526 # Only a case insensitive filesystem needs magic to translate user input 1526 # Only a case insensitive filesystem needs magic to translate user input
1527 # to actual case in the filesystem. 1527 # to actual case in the filesystem.
1528 matcherfunc = matchmod.match
1528 if not util.fscasesensitive(r.root): 1529 if not util.fscasesensitive(r.root):
1529 return matchmod.icasefsmatcher(r.root, r.getcwd(), pats, 1530 matcherfunc = matchmod.icasefsmatcher
1530 include, exclude, default, r.auditor, 1531 return matcherfunc(r.root, r.getcwd(), pats,
1531 self, listsubrepos=listsubrepos, 1532 include, exclude, default,
1532 badfn=badfn) 1533 auditor=r.auditor, ctx=self,
1533 return matchmod.match(r.root, r.getcwd(), pats, 1534 listsubrepos=listsubrepos, badfn=badfn)
1534 include, exclude, default,
1535 auditor=r.auditor, ctx=self,
1536 listsubrepos=listsubrepos, badfn=badfn)
1537 1535
1538 def _filtersuspectsymlink(self, files): 1536 def _filtersuspectsymlink(self, files):
1539 if not files or self._repo.dirstate._checklink: 1537 if not files or self._repo.dirstate._checklink:
1540 return files 1538 return files
1541 1539