352
352
_set_base_is_other_ancestor)
355
def from_uncommitted(tree, other_tree, pb=None, base_tree=None):
355
def from_uncommitted(tree, other_tree, base_tree=None):
356
356
"""Return a Merger for uncommitted changes in other_tree.
358
358
:param tree: The tree to merge into
359
359
:param other_tree: The tree to get uncommitted changes from
360
:param pb: A progress indicator
361
360
:param base_tree: The basis to use for the merge. If unspecified,
362
361
other_tree.basis_tree() will be used.
364
363
if base_tree is None:
365
364
base_tree = other_tree.basis_tree()
366
merger = Merger(tree.branch, other_tree, base_tree, tree, pb)
365
merger = Merger(tree.branch, other_tree, base_tree, tree)
367
366
merger.base_rev_id = merger.base_tree.get_revision_id()
368
367
merger.other_rev_id = None
369
368
merger.other_basis = merger.base_rev_id
373
def from_mergeable(klass, tree, mergeable, pb):
372
def from_mergeable(klass, tree, mergeable):
374
373
"""Return a Merger for a bundle or merge directive.
376
375
:param tree: The tree to merge changes into
377
376
:param mergeable: A merge directive or bundle
378
:param pb: A progress indicator
380
378
mergeable.install_revisions(tree.branch.repository)
381
379
base_revision_id, other_revision_id, verified =\
388
386
base_revision_id = None
390
388
trace.warning('Performing cherrypick')
391
merger = klass.from_revision_ids(pb, tree, other_revision_id,
389
merger = klass.from_revision_ids(tree, other_revision_id,
392
390
base_revision_id, revision_graph=
394
392
return merger, verified
397
def from_revision_ids(pb, tree, other, base=None, other_branch=None,
395
def from_revision_ids(tree, other, base=None, other_branch=None,
398
396
base_branch=None, revision_graph=None,
399
397
tree_branch=None):
400
398
"""Return a Merger for revision-ids.
402
:param pb: A progress indicator
403
400
:param tree: The tree to merge changes into
404
401
:param other: The revision-id to use as OTHER
405
402
:param base: The revision-id to use as BASE. If not specified, will
416
413
if tree_branch is None:
417
414
tree_branch = tree.branch
418
merger = Merger(tree_branch, this_tree=tree, pb=pb,
415
merger = Merger(tree_branch, this_tree=tree,
419
416
revision_graph=revision_graph)
420
417
if other_branch is None:
421
418
other_branch = tree.branch
640
637
if self._is_criss_cross and getattr(self.merge_type,
641
638
'supports_lca_trees', False):
642
639
kwargs['lca_trees'] = self._lca_trees
643
return self.merge_type(pb=None,
644
change_reporter=self.change_reporter,
640
return self.merge_type(change_reporter=self.change_reporter,
647
643
def _do_merge_to(self):
1926
1921
raise errors.BzrError("breezy.merge.merge_inner requires a this_tree "
1928
1923
merger = Merger(this_branch, other_tree, base_tree, this_tree=this_tree,
1929
pb=pb, change_reporter=change_reporter)
1924
change_reporter=change_reporter)
1930
1925
merger.backup_files = backup_files
1931
1926
merger.merge_type = merge_type
1932
1927
merger.interesting_ids = interesting_ids