~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1644
1644
    by_parent = tt.by_parent()
1645
1645
    for child in by_parent[old_parent]:
1646
1646
        tt.adjust_path(tt.final_name(child), new_parent, child)
1647
 
    return by_parent[old_parent]
1648
1647
 
1649
1648
def _content_match(tree, entry, file_id, kind, target_path):
1650
1649
    if entry.kind != kind:
2020
2019
                new_conflicts.add(('deleting parent', 'Not deleting', 
2021
2020
                                   trans_id))
2022
2021
            except KeyError:
2023
 
                create = True
 
2022
                tt.create_directory(trans_id)
 
2023
                new_conflicts.add((c_type, 'Created directory', trans_id))
2024
2024
                try:
2025
2025
                    tt.final_name(trans_id)
2026
2026
                except NoFinalPath:
2027
2027
                    if path_tree is not None:
2028
2028
                        file_id = tt.final_file_id(trans_id)
2029
 
                        if file_id is None:
2030
 
                            file_id = tt.inactive_file_id(trans_id)
2031
2029
                        entry = path_tree.inventory[file_id]
2032
 
                        # special-case the other tree root (move its
2033
 
                        # children to current root)
2034
 
                        if entry.parent_id is None:
2035
 
                            create=False
2036
 
                            moved = _reparent_transform_children(
2037
 
                                tt, trans_id, tt.root)
2038
 
                            for child in moved:
2039
 
                                new_conflicts.add((c_type, 'Moved to root',
2040
 
                                                   child))
2041
 
                        else:
2042
 
                            parent_trans_id = tt.trans_id_file_id(
2043
 
                                entry.parent_id)
2044
 
                            tt.adjust_path(entry.name, parent_trans_id,
2045
 
                                           trans_id)
2046
 
                if create:
2047
 
                    tt.create_directory(trans_id)
2048
 
                    new_conflicts.add((c_type, 'Created directory', trans_id))
 
2030
                        parent_trans_id = tt.trans_id_file_id(entry.parent_id)
 
2031
                        tt.adjust_path(entry.name, parent_trans_id, trans_id)
2049
2032
        elif c_type == 'unversioned parent':
2050
 
            file_id = tt.inactive_file_id(conflict[1])
2051
 
            # special-case the other tree root (move its children instead)
2052
 
            if path_tree and file_id in path_tree:
2053
 
                if path_tree.inventory[file_id].parent_id is None:
2054
 
                    continue
2055
 
            tt.version_file(file_id, conflict[1])
 
2033
            tt.version_file(tt.inactive_file_id(conflict[1]), conflict[1])
2056
2034
            new_conflicts.add((c_type, 'Versioned directory', conflict[1]))
2057
2035
        elif c_type == 'non-directory parent':
2058
2036
            parent_id = conflict[1]