~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-23 01:25:18 UTC
  • mfrom: (4560.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090723012518-txkanz7di5glol2c
(igc) Allow rename of items already removed from the inventory
        (Marius Kruger)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1476
1476
        from_tail = splitpath(from_rel)[-1]
1477
1477
        from_id = inv.path2id(from_rel)
1478
1478
        if from_id is None:
1479
 
            raise errors.BzrRenameFailedError(from_rel,to_rel,
1480
 
                errors.NotVersionedError(path=str(from_rel)))
1481
 
        from_entry = inv[from_id]
 
1479
            # if file is missing in the inventory maybe it's in the basis_tree
 
1480
            basis_tree = self.branch.basis_tree()
 
1481
            from_id = basis_tree.path2id(from_rel)
 
1482
            if from_id is None:
 
1483
                raise errors.BzrRenameFailedError(from_rel,to_rel,
 
1484
                    errors.NotVersionedError(path=str(from_rel)))
 
1485
            # put entry back in the inventory so we can rename it
 
1486
            from_entry = basis_tree.inventory[from_id].copy()
 
1487
            inv.add(from_entry)
 
1488
        else:
 
1489
            from_entry = inv[from_id]
1482
1490
        from_parent_id = from_entry.parent_id
1483
1491
        to_dir, to_tail = os.path.split(to_rel)
1484
1492
        to_dir_id = inv.path2id(to_dir)