774 if name == 'ignore' or name.startswith('ignore.'): |
775 if name == 'ignore' or name.startswith('ignore.'): |
775 # we need to use os.path.join here rather than self._join |
776 # we need to use os.path.join here rather than self._join |
776 # because path is arbitrary and user-specified |
777 # because path is arbitrary and user-specified |
777 files.append(os.path.join(self._rootdir, util.expandpath(path))) |
778 files.append(os.path.join(self._rootdir, util.expandpath(path))) |
778 return files |
779 return files |
|
780 |
|
781 def _ignorefileandline(self, f): |
|
782 files = collections.deque(self._ignorefiles()) |
|
783 visited = set() |
|
784 while files: |
|
785 i = files.popleft() |
|
786 patterns = matchmod.readpatternfile(i, self._ui.warn, |
|
787 sourceinfo=True) |
|
788 for pattern, lineno, line in patterns: |
|
789 kind, p = matchmod._patsplit(pattern, 'glob') |
|
790 if kind == "subinclude": |
|
791 if p not in visited: |
|
792 files.append(p) |
|
793 continue |
|
794 m = matchmod.match(self._root, '', [], [pattern], |
|
795 warn=self._ui.warn) |
|
796 if m(f): |
|
797 return (i, lineno, line) |
|
798 visited.add(i) |
|
799 return (None, -1, "") |
779 |
800 |
780 def _walkexplicit(self, match, subrepos): |
801 def _walkexplicit(self, match, subrepos): |
781 '''Get stat data about the files explicitly specified by match. |
802 '''Get stat data about the files explicitly specified by match. |
782 |
803 |
783 Return a triple (results, dirsfound, dirsnotfound). |
804 Return a triple (results, dirsfound, dirsnotfound). |