~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
2628
2628
                tt.adjust_path(name[1], parent_trans, trans_id)
2629
2629
            if executable[0] != executable[1] and kind[1] == "file":
2630
2630
                tt.set_executability(executable[1], trans_id)
2631
 
        for (trans_id, mode_id), bytes in target_tree.iter_files_bytes(
2632
 
            deferred_files):
2633
 
            tt.create_file(bytes, trans_id, mode_id)
 
2631
        if working_tree.supports_content_filtering():
 
2632
            for index, ((trans_id, mode_id), bytes) in enumerate(
 
2633
                target_tree.iter_files_bytes(deferred_files)):
 
2634
                file_id = deferred_files[index][0]
 
2635
                # We're reverting a tree to the target tree so using the
 
2636
                # target tree to find the file path seems the best choice
 
2637
                # here IMO - Ian C 27/Oct/2009
 
2638
                filter_tree_path = target_tree.id2path(file_id)
 
2639
                filters = working_tree._content_filter_stack(filter_tree_path)
 
2640
                bytes = filtered_output_bytes(bytes, filters,
 
2641
                    ContentFilterContext(filter_tree_path, working_tree))
 
2642
                tt.create_file(bytes, trans_id, mode_id)
 
2643
        else:
 
2644
            for (trans_id, mode_id), bytes in target_tree.iter_files_bytes(
 
2645
                deferred_files):
 
2646
                tt.create_file(bytes, trans_id, mode_id)
2634
2647
    finally:
2635
2648
        if basis_tree is not None:
2636
2649
            basis_tree.unlock()