~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2007-06-01 05:43:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2500.
  • Revision ID: aaron.bentley@utoronto.ca-20070601054311-15wtrjil1onbuea3
Revert does not try to preserve file contents produced by revert

Show diffs side-by-side

added added

removed removed

Lines of Context:
1420
1420
        pp.next_phase()
1421
1421
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
1422
1422
        try:
1423
 
            _alter_files(working_tree, target_tree, tt, child_pb,
1424
 
                         filenames, backups)
 
1423
            merge_modified = _alter_files(working_tree, target_tree, tt,
 
1424
                                          child_pb, filenames, backups)
1425
1425
        finally:
1426
1426
            child_pb.finished()
1427
1427
        pp.next_phase()
1439
1439
            warning(conflict)
1440
1440
        pp.next_phase()
1441
1441
        tt.apply()
1442
 
        working_tree.set_merge_modified({})
 
1442
        working_tree.set_merge_modified(merge_modified)
1443
1443
    finally:
1444
1444
        target_tree.unlock()
1445
1445
        tt.finalize()
1505
1505
                elif kind[1] == 'file':
1506
1506
                    tt.create_file(target_tree.get_file_lines(file_id),
1507
1507
                                   trans_id, mode_id)
 
1508
                    if basis_tree is None:
 
1509
                        basis_tree = working_tree.basis_tree()
 
1510
                        basis_tree.lock_read()
 
1511
                    new_sha1 = target_tree.get_file_sha1(file_id)
 
1512
                    if (file_id in basis_tree and new_sha1 ==
 
1513
                        basis_tree.get_file_sha1(file_id)):
 
1514
                        if file_id in merge_modified:
 
1515
                            del merge_modified[file_id]
 
1516
                    else:
 
1517
                        merge_modified[file_id] = new_sha1
 
1518
 
1508
1519
                    # preserve the execute bit when backing up
1509
1520
                    if keep_content and executable[0] == executable[1]:
1510
1521
                        tt.set_executability(executable[1], trans_id)
1523
1534
    finally:
1524
1535
        if basis_tree is not None:
1525
1536
            basis_tree.unlock()
 
1537
    return merge_modified
1526
1538
 
1527
1539
 
1528
1540
def resolve_conflicts(tt, pb=DummyProgress(), pass_func=None):