/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

Raise SettingFileIdUnsupported

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
                continue
193
193
            yield self.path2id(path)
194
194
 
195
 
    def _index_add_entry(self, path, file_id, kind):
 
195
    def _index_add_entry(self, path, kind):
196
196
        assert self._lock_mode is not None
197
197
        assert isinstance(path, basestring)
198
 
        assert type(file_id) == str or file_id is None
199
198
        if kind == "directory":
200
199
            # Git indexes don't contain directories
201
200
            return
202
201
        if kind == "file":
203
202
            blob = Blob()
204
203
            try:
205
 
                file, stat_val = self.get_file_with_stat(file_id, path)
 
204
                file, stat_val = self.get_file_with_stat(None, path)
206
205
            except (errors.NoSuchFile, IOError):
207
206
                # TODO: Rather than come up with something here, use the old index
208
207
                file = StringIO()
219
218
                stat_val = os.stat_result(
220
219
                    (stat.S_IFLNK, 0, 0, 0, 0, 0, 0, 0, 0, 0))
221
220
            blob.set_raw_string(
222
 
                self.get_symlink_target(file_id, path).encode("utf-8"))
 
221
                self.get_symlink_target(None, path).encode("utf-8"))
223
222
        else:
224
223
            raise AssertionError("unknown kind '%s'" % kind)
225
224
        # Add object to the repository if it didn't exist yet
342
341
    def _add(self, files, ids, kinds):
343
342
        for (path, file_id, kind) in zip(files, ids, kinds):
344
343
            if file_id is not None:
345
 
                self._fileid_map.set_file_id(path.encode("utf-8"), file_id)
346
 
            else:
347
 
                file_id = self._fileid_map.lookup_file_id(path.encode("utf-8"))
348
 
            self._index_add_entry(path, file_id, kind)
 
344
                raise workingtree.SettingFileIdUnsupported()
 
345
            self._index_add_entry(path, kind)
349
346
 
350
347
    @needs_tree_write_lock
351
348
    def smart_add(self, file_list, recurse=True, action=None, save=True):