/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2011-06-28 17:25:26 UTC
  • mfrom: (5999 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110628172526-10cok2s17dvw7x62
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1617
1617
 
1618
1618
    def cook_conflicts(self, fs_conflicts):
1619
1619
        """Convert all conflicts into a form that doesn't depend on trans_id"""
1620
 
        self.cooked_conflicts.extend(transform.cook_conflicts(
1621
 
                fs_conflicts, self.tt))
 
1620
        content_conflict_file_ids = set()
 
1621
        cooked_conflicts = transform.cook_conflicts(fs_conflicts, self.tt)
1622
1622
        fp = transform.FinalPaths(self.tt)
1623
1623
        for conflict in self._raw_conflicts:
1624
1624
            conflict_type = conflict[0]
1654
1654
                        break
1655
1655
                c = _mod_conflicts.Conflict.factory(conflict_type,
1656
1656
                                                    path=path, file_id=file_id)
 
1657
                content_conflict_file_ids.add(file_id)
1657
1658
            elif conflict_type == 'text conflict':
1658
1659
                trans_id = conflict[1]
1659
1660
                path = fp.get_path(trans_id)
1662
1663
                                                    path=path, file_id=file_id)
1663
1664
            else:
1664
1665
                raise AssertionError('bad conflict type: %r' % (conflict,))
 
1666
            cooked_conflicts.append(c)
 
1667
 
 
1668
        self.cooked_conflicts = []
 
1669
        # We want to get rid of path conflicts when a corresponding contents
 
1670
        # conflict exists. This can occur when one branch deletes a file while
 
1671
        # the other renames *and* modifies it. In this case, the content
 
1672
        # conflict is enough.
 
1673
        for c in cooked_conflicts:
 
1674
            if (c.typestring == 'path conflict'
 
1675
                and c.file_id in content_conflict_file_ids):
 
1676
                continue
1665
1677
            self.cooked_conflicts.append(c)
1666
1678
        self.cooked_conflicts.sort(key=_mod_conflicts.Conflict.sort_key)
1667
1679
 
1955
1967
    """
1956
1968
    if this_tree is None:
1957
1969
        raise errors.BzrError("bzrlib.merge.merge_inner requires a this_tree "
1958
 
                              "parameter as of bzrlib version 0.8.")
 
1970
                              "parameter")
1959
1971
    merger = Merger(this_branch, other_tree, base_tree, this_tree=this_tree,
1960
1972
                    pb=pb, change_reporter=change_reporter)
1961
1973
    merger.backup_files = backup_files