~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1645
1645
        pb.clear()
1646
1646
 
1647
1647
 
1648
 
def conflict_pass(tt, conflicts):
1649
 
    """Resolve some classes of conflicts."""
 
1648
def conflict_pass(tt, conflicts, path_tree=None):
 
1649
    """Resolve some classes of conflicts.
 
1650
 
 
1651
    :param tt: The transform to resolve conflicts in
 
1652
    :param conflicts: The conflicts to resolve
 
1653
    :param path_tree: A Tree to get supplemental paths from
 
1654
    """
1650
1655
    new_conflicts = set()
1651
1656
    for c_type, conflict in ((c[0], c) for c in conflicts):
1652
1657
        if c_type == 'duplicate id':
1683
1688
            except KeyError:
1684
1689
                tt.create_directory(trans_id)
1685
1690
                new_conflicts.add((c_type, 'Created directory', trans_id))
 
1691
                try:
 
1692
                    tt.final_name(trans_id)
 
1693
                except NoFinalPath:
 
1694
                    file_id = tt.final_file_id(trans_id)
 
1695
                    entry = path_tree.inventory[file_id]
 
1696
                    parent_trans_id = tt.trans_id_file_id(entry.parent_id)
 
1697
                    tt.adjust_path(entry.name, parent_trans_id, trans_id)
1686
1698
        elif c_type == 'unversioned parent':
1687
1699
            tt.version_file(tt.inactive_file_id(conflict[1]), conflict[1])
1688
1700
            new_conflicts.add((c_type, 'Versioned directory', conflict[1]))