~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-20 22:14:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1877.
  • Revision ID: john@arbash-meinel.com-20060720221438-f91ad8cc36e0b576
Change ignore functions to use sets instead of lists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1105
1105
 
1106
1106
        Cached in the Tree object after the first call.
1107
1107
        """
1108
 
        ignorelist = getattr(self, '_ignorelist', None)
1109
 
        if ignorelist is not None:
1110
 
            return ignorelist
1111
 
 
1112
 
        ignore_globs = (bzrlib.DEFAULT_IGNORE[:] +
1113
 
                        list(ignores.get_runtime_ignores()))
1114
 
 
1115
 
        ignore_globs.extend(ignores.get_user_ignores())
 
1108
        ignoreset = getattr(self, '_ignoreset', None)
 
1109
        if ignoreset is not None:
 
1110
            return ignoreset
 
1111
 
 
1112
        ignore_globs = set(bzrlib.DEFAULT_IGNORE)
 
1113
        ignore_globs.update(ignores.get_runtime_ignores())
 
1114
 
 
1115
        ignore_globs.update(ignores.get_user_ignores())
1116
1116
 
1117
1117
        if self.has_filename(bzrlib.IGNORE_FILENAME):
1118
1118
            f = self.get_file_byname(bzrlib.IGNORE_FILENAME)
1119
1119
            try:
1120
 
                ignore_globs.extend(ignores.parse_ignore_file(f))
 
1120
                ignore_globs.update(ignores.parse_ignore_file(f))
1121
1121
            finally:
1122
1122
                f.close()
1123
1123
 
1124
 
        self._ignorelist = ignore_globs
 
1124
        self._ignoreset = ignore_globs
1125
1125
        self._ignore_regex = self._combine_ignore_rules(ignore_globs)
1126
1126
        return ignore_globs
1127
1127
 
1131
1131
        :return: (ignore rules compiled regex, dictionary mapping rule group 
1132
1132
        indices to original rule.)
1133
1133
        """
1134
 
        if getattr(self, '_ignorelist', None) is None:
 
1134
        if getattr(self, '_ignoreset', None) is None:
1135
1135
            self.get_ignore_list()
1136
1136
        return self._ignore_regex
1137
1137