884
884
def build_tree(tree, wt):
885
885
"""Create working tree for a branch, using a Transaction."""
886
886
file_trans_id = {}
887
top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
888
pp = ProgressPhase("Build phase", 2, top_pb)
887
889
tt = TreeTransform(wt)
889
892
file_trans_id[wt.get_root_id()] = tt.trans_id_tree_file_id(wt.get_root_id())
890
893
file_ids = topology_sorted_ids(tree)
891
for file_id in file_ids:
892
entry = tree.inventory[file_id]
893
if entry.parent_id is None:
895
if entry.parent_id not in file_trans_id:
896
raise repr(entry.parent_id)
897
parent_id = file_trans_id[entry.parent_id]
898
file_trans_id[file_id] = new_by_entry(tt, entry, parent_id, tree)
894
pb = bzrlib.ui.ui_factory.nested_progress_bar()
896
for num, file_id in enumerate(file_ids):
897
pb.update("Building tree", num, len(file_ids))
898
entry = tree.inventory[file_id]
899
if entry.parent_id is None:
901
if entry.parent_id not in file_trans_id:
902
raise repr(entry.parent_id)
903
parent_id = file_trans_id[entry.parent_id]
904
file_trans_id[file_id] = new_by_entry(tt, entry, parent_id,
903
914
def new_by_entry(tt, entry, parent_id, tree):
904
915
"""Create a new file according to its inventory entry"""