~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2007-12-09 23:53:50 UTC
  • mto: This revision was merged to the branch mainline in revision 3133.
  • Revision ID: aaron.bentley@utoronto.ca-20071209235350-qp39yk0xzx7a4f6p
Don't use the base if not cherrypicking

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
        if (not getattr(self.merge_type, 'supports_reverse_cherrypick', True)
373
373
            and not self.base_is_other_ancestor):
374
374
            raise errors.CannotReverseCherrypick()
 
375
        if self.merge_type.history_based:
 
376
            kwargs['cherrypick'] = (not self.base_is_ancestor or
 
377
                                    not self.base_is_other_ancestor)
375
378
        self.this_tree.lock_tree_write()
376
379
        if self.base_tree is not None:
377
380
            self.base_tree.lock_read()
983
986
    supports_reprocess = True
984
987
    supports_show_base = False
985
988
    supports_reverse_cherrypick = False
 
989
    history_based = True
986
990
 
987
991
    def __init__(self, working_tree, this_tree, base_tree, other_tree, 
988
992
                 interesting_ids=None, pb=DummyProgress(), pp=None,
989
993
                 reprocess=False, change_reporter=None,
990
 
                 interesting_files=None):
 
994
                 interesting_files=None, cherrypick=False):
 
995
        self.cherrypick = cherrypick
991
996
        super(WeaveMerger, self).__init__(working_tree, this_tree, 
992
997
                                          base_tree, other_tree, 
993
998
                                          interesting_ids=interesting_ids, 
999
1004
        There is no distinction between lines that are meant to contain <<<<<<<
1000
1005
        and conflicts.
1001
1006
        """
 
1007
        if self.cherrypick:
 
1008
            base = self.base_tree
 
1009
        else:
 
1010
            base = None
1002
1011
        plan = self.this_tree.plan_file_merge(file_id, self.other_tree,
1003
 
                                              base=self.base_tree)
 
1012
                                              base=base)
1004
1013
        if 'merge' in debug.debug_flags:
1005
1014
            plan = list(plan)
1006
1015
            trans_id = self.tt.trans_id_file_id(file_id)