/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

update copyright years

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from dulwich.objects import (
26
26
    Blob,
27
27
    )
28
 
from dulwich.protocol import (
29
 
    ZERO_SHA,
30
 
    )
31
28
import os
32
29
import stat
33
30
 
53
50
    changes_from_git_changes,
54
51
    tree_delta_from_git_changes,
55
52
    )
56
 
from bzrlib.plugins.git.mapping import (
57
 
    GitFileIdMap,
58
 
    )
 
53
 
59
54
 
60
55
IGNORE_FILENAME = ".gitignore"
61
56
 
150
145
        # TODO: Maybe this should only write on dirty ?
151
146
        if self._control_files._lock_mode != 'w':
152
147
            raise errors.NotWriteLocked(self)
153
 
        self._rewrite_index()
 
148
        self._rewrite_index()           
154
149
        self.index.write()
155
150
        self._inventory_is_modified = False
156
151
 
180
175
            head = self.repository._git.head()
181
176
        except KeyError, name:
182
177
            raise errors.NotBranchError("branch %s at %s" % (name, self.repository.base))
183
 
        basis_inv = self.repository.get_inventory(self.branch.lookup_foreign_revision_id(head))
184
 
        store = self.repository._git.object_store
185
 
        if head == ZERO_SHA:
186
 
            fileid_map = GitFileIdMap({}, self.mapping)
187
 
            basis_inv = None
188
 
        else:
189
 
            fileid_map = self.mapping.get_fileid_map(store.__getitem__,
190
 
                store[head].tree)
191
 
        result = GitIndexInventory(basis_inv, fileid_map, self.index, store)
 
178
        basis_inv = self.repository.get_inventory(self.mapping.revision_id_foreign_to_bzr(head))
 
179
        result = GitIndexInventory(basis_inv, self.mapping, self.index,
 
180
            self.repository._git.object_store)
192
181
        self._set_inventory(result, dirty=False)
193
182
 
194
183
    @needs_read_lock
215
204
 
216
205
    @property
217
206
    def _matchingbzrdir(self):
218
 
        from bzrlib.plugins.git import LocalGitControlDirFormat
219
 
        return LocalGitControlDirFormat()
 
207
        from bzrlib.plugins.git import LocalGitBzrDirFormat
 
208
        return LocalGitBzrDirFormat()
220
209
 
221
210
    def get_format_description(self):
222
211
        return "Git Working Tree"
241
230
        changes = self._index.changes_from_tree(
242
231
            self.source._repository._git.object_store, self.source.tree, 
243
232
            want_unchanged=want_unchanged)
244
 
        source_fileid_map = self.source.mapping.get_fileid_map(
245
 
            self.source._repository._git.object_store.__getitem__,
246
 
            self.source.tree)
247
 
        if self.target.mapping.BZR_FILE_IDS_FILE is not None:
248
 
            file_id = self.target.path2id(
249
 
                self.target.mapping.BZR_FILE_IDS_FILE)
250
 
            if file_id is None:
251
 
                target_fileid_map = {}
252
 
            else:
253
 
                target_fileid_map = self.target.mapping.import_fileid_map(Blob.from_string(self.target.get_file_text(file_id)))
254
 
        else:
255
 
            target_fileid_map = {}
256
 
        target_fileid_map = GitFileIdMap(target_fileid_map, self.target.mapping)
257
 
        ret = tree_delta_from_git_changes(changes, self.target.mapping,
258
 
            (source_fileid_map, target_fileid_map),
 
233
        ret = tree_delta_from_git_changes(changes, self.target.mapping, 
259
234
            specific_file=specific_files, require_versioned=require_versioned)
260
235
        if want_unversioned:
261
236
            for e in self.target.extras():