##// END OF EJS Templates
dirstate: add a way to get the ignore file/line matching an ignored file...
Laurent Charignon -
r27670:4374f039 default
parent child Browse files
Show More
@@ -7,6 +7,7 b''
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import collections
10 import errno
11 import errno
11 import os
12 import os
12 import stat
13 import stat
@@ -777,6 +778,26 b' class dirstate(object):'
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
779
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, "")
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
General Comments 0
You need to be logged in to leave comments. Login now