/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

Use support opening index of first revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from bzrlib import (
35
35
    errors,
36
36
    ignores,
37
 
    inventory,
38
37
    lockable_files,
39
38
    lockdir,
40
39
    osutils,
151
150
        # TODO: Maybe this should only write on dirty ?
152
151
        if self._control_files._lock_mode != 'w':
153
152
            raise errors.NotWriteLocked(self)
154
 
        self._rewrite_index()           
 
153
        self._rewrite_index()
155
154
        self.index.write()
156
155
        self._inventory_is_modified = False
157
156
 
184
183
        basis_inv = self.repository.get_inventory(self.branch.lookup_foreign_revision_id(head))
185
184
        store = self.repository._git.object_store
186
185
        if head == ZERO_SHA:
187
 
            fileid_map = {}
188
 
            result = inventory.Inventory(root_id=None)
 
186
            fileid_map = GitFileIdMap({}, self.mapping)
 
187
            basis_inv = None
189
188
        else:
190
189
            fileid_map = self.mapping.get_fileid_map(store.__getitem__,
191
190
                store[head].tree)
192
 
            result = GitIndexInventory(basis_inv, fileid_map, self.index, store)
 
191
        result = GitIndexInventory(basis_inv, fileid_map, self.index, store)
193
192
        self._set_inventory(result, dirty=False)
194
193
 
195
194
    @needs_read_lock