/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

Fill in sha1s in inventory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                    # TODO: Rather than come up with something here, use the old index
109
109
                    file = StringIO()
110
110
                    stat_val = (0, 0, 0, 0, stat.S_IFREG | 0644, 0, 0, 0, 0, 0)
111
 
                blob._text = file.read()
 
111
                blob.set_raw_string(file.read())
112
112
            elif entry.kind == "symlink":
113
113
                blob = Blob()
114
 
                stat_val = os.stat(self.abspath(path))
115
 
                blob._text = entry.symlink_target
 
114
                try:
 
115
                    stat_val = os.lstat(self.abspath(path))
 
116
                except (errors.NoSuchFile, OSError):
 
117
                    # TODO: Rather than come up with something here, use the 
 
118
                    # old index
 
119
                    stat_val = (0, 0, 0, 0, stat.S_IFLNK, 0, 0, 0, 0, 0)
 
120
                blob.set_raw_string(entry.symlink_target)
116
121
            # Add object to the repository if it didn't exist yet
117
122
            if not blob.id in self.repository._git.object_store:
118
123
                self.repository._git.object_store.add_object(blob)
149
154
    def _reset_data(self):
150
155
        self._inventory_is_modified = False
151
156
        basis_inv = self.repository.get_inventory(self.mapping.revision_id_foreign_to_bzr(self.repository._git.head()))
152
 
        result = GitIndexInventory(basis_inv, self.mapping, self.index)
 
157
        result = GitIndexInventory(basis_inv, self.mapping, self.index,
 
158
            self.repository._git.object_store)
153
159
        self._set_inventory(result, dirty=False)
154
160
 
155
161
    @needs_read_lock