/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 breezy/merge.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
    hooks = MergeHooks()
281
281
 
282
282
    def __init__(self, this_branch, other_tree=None, base_tree=None,
283
 
                 this_tree=None, pb=None, change_reporter=None,
 
283
                 this_tree=None, change_reporter=None,
284
284
                 recurse='down', revision_graph=None):
285
285
        object.__init__(self)
286
286
        self.this_branch = this_branch
299
299
        self.interesting_files = None
300
300
        self.show_base = False
301
301
        self.reprocess = False
302
 
        if pb is not None:
303
 
            warnings.warn("pb parameter to Merger() is deprecated and ignored")
304
302
        self.pp = None
305
303
        self.recurse = recurse
306
304
        self.change_reporter = change_reporter
354
352
                                      _set_base_is_other_ancestor)
355
353
 
356
354
    @staticmethod
357
 
    def from_uncommitted(tree, other_tree, pb=None, base_tree=None):
 
355
    def from_uncommitted(tree, other_tree, base_tree=None):
358
356
        """Return a Merger for uncommitted changes in other_tree.
359
357
 
360
358
        :param tree: The tree to merge into
361
359
        :param other_tree: The tree to get uncommitted changes from
362
 
        :param pb: A progress indicator
363
360
        :param base_tree: The basis to use for the merge.  If unspecified,
364
361
            other_tree.basis_tree() will be used.
365
362
        """
366
363
        if base_tree is None:
367
364
            base_tree = other_tree.basis_tree()
368
 
        merger = Merger(tree.branch, other_tree, base_tree, tree, pb)
 
365
        merger = Merger(tree.branch, other_tree, base_tree, tree)
369
366
        merger.base_rev_id = merger.base_tree.get_revision_id()
370
367
        merger.other_rev_id = None
371
368
        merger.other_basis = merger.base_rev_id
372
369
        return merger
373
370
 
374
371
    @classmethod
375
 
    def from_mergeable(klass, tree, mergeable, pb):
 
372
    def from_mergeable(klass, tree, mergeable):
376
373
        """Return a Merger for a bundle or merge directive.
377
374
 
378
375
        :param tree: The tree to merge changes into
379
376
        :param mergeable: A merge directive or bundle
380
 
        :param pb: A progress indicator
381
377
        """
382
378
        mergeable.install_revisions(tree.branch.repository)
383
379
        base_revision_id, other_revision_id, verified =\
390
386
                base_revision_id = None
391
387
            else:
392
388
                trace.warning('Performing cherrypick')
393
 
        merger = klass.from_revision_ids(pb, tree, other_revision_id,
 
389
        merger = klass.from_revision_ids(tree, other_revision_id,
394
390
                                         base_revision_id, revision_graph=
395
391
                                         revision_graph)
396
392
        return merger, verified
397
393
 
398
394
    @staticmethod
399
 
    def from_revision_ids(pb, tree, other, base=None, other_branch=None,
 
395
    def from_revision_ids(tree, other, base=None, other_branch=None,
400
396
                          base_branch=None, revision_graph=None,
401
397
                          tree_branch=None):
402
398
        """Return a Merger for revision-ids.
403
399
 
404
 
        :param pb: A progress indicator
405
400
        :param tree: The tree to merge changes into
406
401
        :param other: The revision-id to use as OTHER
407
402
        :param base: The revision-id to use as BASE.  If not specified, will
417
412
        """
418
413
        if tree_branch is None:
419
414
            tree_branch = tree.branch
420
 
        merger = Merger(tree_branch, this_tree=tree, pb=pb,
 
415
        merger = Merger(tree_branch, this_tree=tree,
421
416
                        revision_graph=revision_graph)
422
417
        if other_branch is None:
423
418
            other_branch = tree.branch
642
637
        if self._is_criss_cross and getattr(self.merge_type,
643
638
                                            'supports_lca_trees', False):
644
639
            kwargs['lca_trees'] = self._lca_trees
645
 
        return self.merge_type(pb=None,
646
 
                               change_reporter=self.change_reporter,
 
640
        return self.merge_type(change_reporter=self.change_reporter,
647
641
                               **kwargs)
648
642
 
649
643
    def _do_merge_to(self):
725
719
 
726
720
    def __init__(self, working_tree, this_tree, base_tree, other_tree,
727
721
                 interesting_ids=None, reprocess=False, show_base=False,
728
 
                 pb=None, pp=None, change_reporter=None,
729
 
                 interesting_files=None, do_merge=True,
 
722
                 change_reporter=None, interesting_files=None, do_merge=True,
730
723
                 cherrypick=False, lca_trees=None, this_branch=None,
731
724
                 other_branch=None):
732
725
        """Initialize the merger object and perform the merge.
744
737
        :param: reprocess If True, perform conflict-reduction processing.
745
738
        :param show_base: If True, show the base revision in text conflicts.
746
739
            (incompatible with reprocess)
747
 
        :param pb: ignored
748
 
        :param pp: A ProgressPhase object
749
740
        :param change_reporter: An object that should report changes made
750
741
        :param interesting_files: The tree-relative paths of files that should
751
742
            participate in the merge.  If these paths refer to directories,
785
776
        self.cherrypick = cherrypick
786
777
        if do_merge:
787
778
            self.do_merge()
788
 
        if pp is not None:
789
 
            warnings.warn("pp argument to Merge3Merger is deprecated")
790
 
        if pb is not None:
791
 
            warnings.warn("pb argument to Merge3Merger is deprecated")
792
779
 
793
780
    def do_merge(self):
794
781
        operation = cleanup.OperationWithCleanups(self._do_merge)
1922
1909
                other_rev_id=None,
1923
1910
                interesting_files=None,
1924
1911
                this_tree=None,
1925
 
                pb=None,
1926
1912
                change_reporter=None):
1927
1913
    """Primary interface for merging.
1928
1914
 
1935
1921
        raise errors.BzrError("breezy.merge.merge_inner requires a this_tree "
1936
1922
                              "parameter")
1937
1923
    merger = Merger(this_branch, other_tree, base_tree, this_tree=this_tree,
1938
 
                    pb=pb, change_reporter=change_reporter)
 
1924
                    change_reporter=change_reporter)
1939
1925
    merger.backup_files = backup_files
1940
1926
    merger.merge_type = merge_type
1941
1927
    merger.interesting_ids = interesting_ids