39
class _TransformResults(object):
40
def __init__(self, modified_paths):
42
self.modified_paths = modified_paths
39
45
class TreeTransform(object):
40
46
"""Represent a tree transformation.
661
667
inv = self._tree.inventory
662
668
self._apply_removals(inv, limbo_inv)
663
self._apply_insertions(inv, limbo_inv)
669
modified_paths = self._apply_insertions(inv, limbo_inv)
664
670
self._tree._write_inventory(inv)
665
671
self.__done = True
673
return _TransformResults(modified_paths)
668
675
def _limbo_name(self, trans_id):
669
676
"""Generate the limbo name of a file"""
711
718
parent-to-child order.
713
720
new_paths = self.new_paths()
714
722
for num, (path, trans_id) in enumerate(new_paths):
715
723
self._pb.update('adding file', num+1, len(new_paths))
726
734
if e.errno != errno.ENOENT:
728
736
if trans_id in self._new_contents:
737
modified_paths.append(full_path)
729
738
del self._new_contents[trans_id]
731
740
if trans_id in self._new_id:
744
753
if trans_id in self._new_executability:
745
754
self._set_executability(path, inv, trans_id)
756
return modified_paths
748
758
def _set_executability(self, path, inv, trans_id):
749
759
"""Set the executability of versioned files """
1001
1011
return interesting_ids is None or file_id in interesting_ids
1003
1013
tt = TreeTransform(working_tree, pb)
1014
merge_modified = working_tree.merge_modified()
1006
1017
def trans_id_file_id(file_id):
1019
1030
e_trans_id = new_by_entry(tt, entry, parent_id, target_tree)
1020
1031
trans_id[file_id] = e_trans_id
1033
backup_this = backups
1034
if file_id in merge_modified:
1036
del merge_modified[file_id]
1022
1037
change_entry(tt, file_id, working_tree, target_tree,
1023
trans_id_file_id, backups, trans_id)
1038
trans_id_file_id, backup_this, trans_id)
1024
1039
wt_interesting = [i for i in working_tree.inventory if interesting(i)]
1025
1040
for id_num, file_id in enumerate(wt_interesting):
1026
1041
pb.update("New file check", id_num+1, len(sorted_interesting))
1027
1042
if file_id not in target_tree:
1028
tt.unversion_file(tt.trans_id_tree_file_id(file_id))
1043
trans_id = tt.trans_id_tree_file_id(file_id)
1044
tt.unversion_file(trans_id)
1045
if file_id in merge_modified:
1046
tt.delete_contents(trans_id)
1047
del merge_modified[file_id]
1029
1048
raw_conflicts = resolve_conflicts(tt, pb)
1030
1049
for line in conflicts_strings(cook_conflicts(raw_conflicts, tt)):
1052
working_tree.set_merge_modified({})