/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to workingtree.py

SupportĀ parsingĀ .gitignore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
from bzrlib import (
34
34
    errors,
 
35
    ignores,
35
36
    inventory,
36
37
    lockable_files,
37
38
    lockdir,
51
52
    )
52
53
 
53
54
 
 
55
IGNORE_FILENAME = ".gitignore"
 
56
 
 
57
 
54
58
class GitWorkingTree(workingtree.WorkingTree):
55
59
    """A Git working tree."""
56
60
 
129
133
        self.index.write()
130
134
        self._inventory_is_modified = False
131
135
 
 
136
    def get_ignore_list(self):
 
137
        ignoreset = getattr(self, '_ignoreset', None)
 
138
        if ignoreset is not None:
 
139
            return ignoreset
 
140
 
 
141
        ignore_globs = set()
 
142
        ignore_globs.update(ignores.get_runtime_ignores())
 
143
        ignore_globs.update(ignores.get_user_ignores())
 
144
        if self.has_filename(IGNORE_FILENAME):
 
145
            f = self.get_file_byname(IGNORE_FILENAME)
 
146
            try:
 
147
                ignore_globs.update(ignores.parse_ignore_file(f))
 
148
            finally:
 
149
                f.close()
 
150
        self._ignoreset = ignore_globs
 
151
        return ignore_globs
 
152
 
132
153
    def _reset_data(self):
133
154
        self._inventory_is_modified = False
134
155
        basis_inv = self.repository.get_inventory(self.mapping.revision_id_foreign_to_bzr(self.repository._git.head()))