~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
            if self.file_id in inv:
194
194
                ie = inv[self.file_id]
195
195
                assert ie.file_id == self.file_id
 
196
                if ie.kind != self.kind:
 
197
                    # Can't be a candidate if the kind has changed.
 
198
                    continue
196
199
                if ie.revision in candidates:
197
200
                    # same revision value in two different inventories:
198
201
                    # correct possible inconsistencies:
491
494
        # renamed
492
495
        elif previous_ie.name != self.name:
493
496
            compatible = False
 
497
        elif previous_ie.kind != self.kind:
 
498
            compatible = False
494
499
        return compatible
495
500
 
496
501
    def _read_tree_state(self, path, work_tree):
1149
1154
            if entry.name in parent.children:
1150
1155
                raise BzrError("%s is already versioned" %
1151
1156
                        osutils.pathjoin(self.id2path(parent.file_id),
1152
 
                        entry.name))
 
1157
                        entry.name).encode('utf-8'))
1153
1158
            parent.children[entry.name] = entry
1154
1159
        return self._add_child(entry)
1155
1160
 
1326
1331
            del self._byid[file_id]
1327
1332
        if ie.parent_id is not None:
1328
1333
            del self[ie.parent_id].children[ie.name]
 
1334
        else:
 
1335
            self.root = None
1329
1336
 
1330
1337
    def rename(self, file_id, new_parent_id, new_name):
1331
1338
        """Move a file within the inventory.