~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-27 20:44:31 UTC
  • mfrom: (1551.8.34 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060927204431-5871ab3ef6affaf3
Revert deletes files that don't exist in target if not locally modified

Show diffs side-by-side

added added

removed removed

Lines of Context:
1229
1229
        pp.next_phase()
1230
1230
        wt_interesting = [i for i in working_tree.inventory if interesting(i)]
1231
1231
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1232
        basis_tree = None
1232
1233
        try:
1233
1234
            for id_num, file_id in enumerate(wt_interesting):
1234
1235
                child_pb.update("New file check", id_num+1, 
1240
1241
                        file_kind = working_tree.kind(file_id)
1241
1242
                    except NoSuchFile:
1242
1243
                        file_kind = None
 
1244
                    delete_merge_modified = (file_id in merge_modified)
1243
1245
                    if file_kind != 'file' and file_kind is not None:
1244
1246
                        keep_contents = False
1245
 
                        delete_merge_modified = False
1246
1247
                    else:
 
1248
                        if basis_tree is None:
 
1249
                            basis_tree = working_tree.basis_tree()
 
1250
                        wt_sha1 = working_tree.get_file_sha1(file_id)
1247
1251
                        if (file_id in merge_modified and 
1248
 
                            merge_modified[file_id] == 
1249
 
                            working_tree.get_file_sha1(file_id)):
1250
 
                            keep_contents = False
1251
 
                            delete_merge_modified = True
 
1252
                            merge_modified[file_id] == wt_sha1):
 
1253
                            keep_contents = False
 
1254
                        elif (file_id in basis_tree and 
 
1255
                            basis_tree.get_file_sha1(file_id) == wt_sha1):
 
1256
                            keep_contents = False
1252
1257
                        else:
1253
1258
                            keep_contents = True
1254
 
                            delete_merge_modified = False
1255
1259
                    if not keep_contents:
1256
1260
                        tt.delete_contents(trans_id)
1257
1261
                    if delete_merge_modified: