~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Andrew Bennetts
  • Date: 2008-04-07 08:20:13 UTC
  • mfrom: (3340 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3344.
  • Revision ID: andrew.bennetts@canonical.com-20080407082013-ca1n1tqqon7ugxiy
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
950
950
        base_executable, other_executable, this_executable = executable
951
951
        if file_status == "deleted":
952
952
            return
953
 
        trans_id = self.tt.trans_id_file_id(file_id)
954
 
        try:
955
 
            if self.tt.final_kind(trans_id) != "file":
956
 
                return
957
 
        except NoSuchFile:
958
 
            return
959
953
        winner = self._three_way(*executable)
960
954
        if winner == "conflict":
961
955
        # There must be a None in here, if we have a conflict, but we
964
958
                winner = "this"
965
959
            else:
966
960
                winner = "other"
 
961
        if winner == 'this' and file_status != "modified":
 
962
            return
 
963
        trans_id = self.tt.trans_id_file_id(file_id)
 
964
        try:
 
965
            if self.tt.final_kind(trans_id) != "file":
 
966
                return
 
967
        except NoSuchFile:
 
968
            return
967
969
        if winner == "this":
968
 
            if file_status == "modified":
969
 
                executability = this_executable
970
 
                if executability is not None:
971
 
                    trans_id = self.tt.trans_id_file_id(file_id)
972
 
                    self.tt.set_executability(executability, trans_id)
 
970
            executability = this_executable
973
971
        else:
974
972
            assert winner == "other"
975
973
            if file_id in self.other_tree:
978
976
                executability = this_executable
979
977
            elif file_id in self.base_tree:
980
978
                executability = base_executable
981
 
            if executability is not None:
982
 
                trans_id = self.tt.trans_id_file_id(file_id)
983
 
                self.tt.set_executability(executability, trans_id)
 
979
        if executability is not None:
 
980
            trans_id = self.tt.trans_id_file_id(file_id)
 
981
            self.tt.set_executability(executability, trans_id)
984
982
 
985
983
    def cook_conflicts(self, fs_conflicts):
986
984
        """Convert all conflicts into a form that doesn't depend on trans_id"""
1403
1401
        """
1404
1402
        if version_id not in self.uncommon:
1405
1403
            return set()
1406
 
        parents = self.vf.get_parents(version_id)
 
1404
        parents = self.vf.get_parent_map([version_id])[version_id]
1407
1405
        if len(parents) == 0:
1408
1406
            return set(range(len(self.vf.get_lines(version_id))))
1409
1407
        new = None