Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 32401:284b18303f61
match: replace icasefsmatch() function by flag to regular match()
match() will soon gain more logic and we don't want to duplicate that
in icasefsmatch(), so merge the two functions instead and use a flag
to get case-insensitive behavior.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 18 May 2017 22:20:59 -0700 |
parents | 24245b54aa8a |
children | 3e2e179ef031 |
comparison
equal
deleted
inserted
replaced
32400:8802c63599e1 | 32401:284b18303f61 |
---|---|
1591 pats = [] | 1591 pats = [] |
1592 r = self._repo | 1592 r = self._repo |
1593 | 1593 |
1594 # Only a case insensitive filesystem needs magic to translate user input | 1594 # Only a case insensitive filesystem needs magic to translate user input |
1595 # to actual case in the filesystem. | 1595 # to actual case in the filesystem. |
1596 matcherfunc = matchmod.match | 1596 icasefs = not util.fscasesensitive(r.root) |
1597 if not util.fscasesensitive(r.root): | 1597 return matchmod.match(r.root, r.getcwd(), pats, include, exclude, |
1598 matcherfunc = matchmod.icasefsmatch | 1598 default, auditor=r.auditor, ctx=self, |
1599 return matcherfunc(r.root, r.getcwd(), pats, | 1599 listsubrepos=listsubrepos, badfn=badfn, |
1600 include, exclude, default, | 1600 icasefs=icasefs) |
1601 auditor=r.auditor, ctx=self, | |
1602 listsubrepos=listsubrepos, badfn=badfn) | |
1603 | 1601 |
1604 def _filtersuspectsymlink(self, files): | 1602 def _filtersuspectsymlink(self, files): |
1605 if not files or self._repo.dirstate._checklink: | 1603 if not files or self._repo.dirstate._checklink: |
1606 return files | 1604 return files |
1607 | 1605 |