/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 bzrlib/workingtree.py

(gz) Don't cast paths to str in workingtree move error conditions (Martin
 [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
1384
1384
        to_dir_id = inv.path2id(to_dir)
1385
1385
        if to_dir_id is None:
1386
1386
            raise errors.BzrMoveFailedError('',to_dir,
1387
 
                errors.NotVersionedError(path=str(to_dir)))
 
1387
                errors.NotVersionedError(path=to_dir))
1388
1388
 
1389
1389
        to_dir_ie = inv[to_dir_id]
1390
1390
        if to_dir_ie.kind != 'directory':
1397
1397
            from_id = inv.path2id(from_rel)
1398
1398
            if from_id is None:
1399
1399
                raise errors.BzrMoveFailedError(from_rel,to_dir,
1400
 
                    errors.NotVersionedError(path=str(from_rel)))
 
1400
                    errors.NotVersionedError(path=from_rel))
1401
1401
 
1402
1402
            from_entry = inv[from_id]
1403
1403
            from_parent_id = from_entry.parent_id
1445
1445
            # check the inventory for source and destination
1446
1446
            if from_id is None:
1447
1447
                raise errors.BzrMoveFailedError(from_rel,to_rel,
1448
 
                    errors.NotVersionedError(path=str(from_rel)))
 
1448
                    errors.NotVersionedError(path=from_rel))
1449
1449
            if to_id is not None:
1450
1450
                raise errors.BzrMoveFailedError(from_rel,to_rel,
1451
 
                    errors.AlreadyVersionedError(path=str(to_rel)))
 
1451
                    errors.AlreadyVersionedError(path=to_rel))
1452
1452
 
1453
1453
            # try to determine the mode for rename (only change inv or change
1454
1454
            # inv and file system)
1455
1455
            if after:
1456
1456
                if not self.has_filename(to_rel):
1457
1457
                    raise errors.BzrMoveFailedError(from_id,to_rel,
1458
 
                        errors.NoSuchFile(path=str(to_rel),
 
1458
                        errors.NoSuchFile(path=to_rel,
1459
1459
                        extra="New file has not been created yet"))
1460
1460
                only_change_inv = True
1461
1461
            elif not self.has_filename(from_rel) and self.has_filename(to_rel):
1563
1563
            from_id = basis_tree.path2id(from_rel)
1564
1564
            if from_id is None:
1565
1565
                raise errors.BzrRenameFailedError(from_rel,to_rel,
1566
 
                    errors.NotVersionedError(path=str(from_rel)))
 
1566
                    errors.NotVersionedError(path=from_rel))
1567
1567
            # put entry back in the inventory so we can rename it
1568
1568
            from_entry = basis_tree.inventory[from_id].copy()
1569
1569
            inv.add(from_entry)
1587
1587
        # versioned
1588
1588
        if to_dir_id is None:
1589
1589
            raise errors.BzrMoveFailedError(from_rel,to_rel,
1590
 
                errors.NotVersionedError(path=str(to_dir)))
 
1590
                errors.NotVersionedError(path=to_dir))
1591
1591
 
1592
1592
        # all checks done. now we can continue with our actual work
1593
1593
        mutter('rename_one:\n'