~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Jelmer Vernooij
  • Date: 2011-06-28 11:58:01 UTC
  • mto: This revision was merged to the branch mainline in revision 5997.
  • Revision ID: jelmer@samba.org-20110628115801-116yzxghzlgtzs83
Fix fixing up root ids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
        self.this_basis_tree = None
279
279
        self.other_tree = other_tree
280
280
        self.other_branch = None
281
 
        self.allow_rootless_tree = True
 
281
        self.allow_rootless_tree = False
282
282
        self.base_tree = base_tree
283
283
        self.ignore_zero = False
284
284
        self.backup_files = False
672
672
        if self._is_criss_cross and getattr(self.merge_type,
673
673
                                            'supports_lca_trees', False):
674
674
            kwargs['lca_trees'] = self._lca_trees
 
675
        if getattr(self.merge_type, "supports_allow_rootless_tree", False):
 
676
            kwargs['allow_rootless_tree'] = self.allow_rootless_tree
675
677
        return self.merge_type(pb=None,
676
678
                               change_reporter=self.change_reporter,
677
679
                               **kwargs)
747
749
    supports_reverse_cherrypick = True
748
750
    winner_idx = {"this": 2, "other": 1, "conflict": 1}
749
751
    supports_lca_trees = True
 
752
    supports_allow_rootless_tree = True
750
753
 
751
754
    def __init__(self, working_tree, this_tree, base_tree, other_tree,
752
755
                 interesting_ids=None, reprocess=False, show_base=False,
753
756
                 pb=None, pp=None, change_reporter=None,
754
757
                 interesting_files=None, do_merge=True,
755
 
                 cherrypick=False, lca_trees=None, this_branch=None):
 
758
                 cherrypick=False, lca_trees=None, this_branch=None,
 
759
                 allow_rootless_tree=False):
756
760
        """Initialize the merger object and perform the merge.
757
761
 
758
762
        :param working_tree: The working tree to apply the merge to
779
783
        :param lca_trees: Can be set to a dictionary of {revision_id:rev_tree}
780
784
            if the ancestry was found to include a criss-cross merge.
781
785
            Otherwise should be None.
 
786
        :param allow_rootless_tree: If True, allow the creation of
 
787
            root-less tree. Otherwise, the old tree root is always kept
 
788
            around if other_tree does not have a root.
782
789
        """
783
790
        object.__init__(self)
784
791
        if interesting_files is not None and interesting_ids is not None:
786
793
                'specify either interesting_ids or interesting_files')
787
794
        if this_branch is None:
788
795
            this_branch = this_tree.branch
 
796
        self.allow_rootless_tree = allow_rootless_tree
789
797
        self.interesting_ids = interesting_ids
790
798
        self.interesting_files = interesting_files
791
799
        self.this_tree = working_tree
869
877
                    executable3, file_status, resolver=resolver)
870
878
        finally:
871
879
            child_pb.finished()
872
 
        self.tt.fixup_new_roots()
 
880
        self.tt.fixup_new_roots(not self.allow_rootless_tree)
873
881
        self._finish_computing_transform()
874
882
 
875
883
    def _finish_computing_transform(self):