/breezy-builder/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-builder/trunk

« back to all changes in this revision

Viewing changes to recipe.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-19 14:06:00 UTC
  • Revision ID: jelmer@jelmer.uk-20180519140600-47c7x7j8wka332cx
Port to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import subprocess
19
19
import time
20
20
 
21
 
from bzrlib import (
 
21
from breezy import (
22
22
    branch as _mod_branch,
23
 
    bzrdir,
 
23
    controldir,
24
24
    errors,
25
25
    merge,
26
26
    revision,
33
33
    )
34
34
 
35
35
try:
36
 
    from bzrlib.errors import NoWhoami
 
36
    from breezy.errors import NoWhoami
37
37
except ImportError:
38
38
    NoWhoami = object()
39
39
 
41
41
try:
42
42
    MergeIntoMerger = merge.MergeIntoMerger
43
43
except (AttributeError, NameError):
44
 
    from bzrlib.plugins.builder.backports import MergeIntoMerger
 
44
    from breezy.plugins.builder.backports import MergeIntoMerger
45
45
 
46
46
 
47
47
def subprocess_setup():
360
360
    if br_to is None:
361
361
        # We do a "branch"
362
362
        ensure_basedir(to_transport)
363
 
        dir = br_from.bzrdir.sprout(to_transport.base, revision_id,
 
363
        dir = br_from.controldir.sprout(to_transport.base, revision_id,
364
364
                                    possible_transports=possible_transports,
365
365
                                    accelerator_tree=accelerator_tree,
366
366
                                    source_branch=br_from,
374
374
            tree_to = dir.create_workingtree()
375
375
        br_to = tree_to.branch
376
376
        created_br_to = True
377
 
        tag._merge_tags_if_possible(br_from, br_to)
 
377
        br_from.tags.merge_to(br_to.tags)
378
378
        created_tree_to = True
379
379
    else:
380
380
        # We do a "pull"
385
385
        else:
386
386
            br_to.pull(br_from, stop_revision=revision_id,
387
387
                    possible_transports=possible_transports)
388
 
            tree_to = br_to.bzrdir.create_workingtree()
 
388
            tree_to = br_to.controldir.create_workingtree()
389
389
            # Ugh, we have to assume that the caller replaces their reference
390
390
            # to the branch with the one we return.
391
391
            br_to.unlock()
426
426
                possible_transports=possible_transports)
427
427
    child_branch.branch.lock_read()
428
428
    try:
429
 
        tag._merge_tags_if_possible(child_branch.branch, br_to)
 
429
        child_branch.branch.tags.merge_to(br_to.tags)
430
430
        if child_branch.revspec is not None:
431
431
            merge_revspec = revisionspec.RevisionSpec.from_string(
432
432
                    child_branch.revspec)
443
443
            merge_revid = child_branch.branch.last_revision()
444
444
        child_branch.revid = merge_revid
445
445
        try:
446
 
            merger = merge.Merger.from_revision_ids(None, tree_to, merge_revid,
 
446
            merger = merge.Merger.from_revision_ids(tree_to, merge_revid,
447
447
                    other_branch=child_branch.branch, tree_branch=br_to)
448
448
        except errors.UnrelatedBranches:
449
449
            # Let's just try and hope for the best.
450
 
            merger = merge.Merger.from_revision_ids(None, tree_to, merge_revid,
 
450
            merger = merge.Merger.from_revision_ids(tree_to, merge_revid,
451
451
                    other_branch=child_branch.branch, tree_branch=br_to,
452
452
                    base=revision.NULL_REVISION)
453
453
        merger.merge_type = merge.Merge3Merger
620
620
    to_transport = transport.get_transport(target_path,
621
621
            possible_transports=possible_transports)
622
622
    try:
623
 
        tree_to, br_to = bzrdir.BzrDir.open_tree_or_branch(target_path)
 
623
        tree_to, br_to = controldir.ControlDir.open_tree_or_branch(target_path)
624
624
        # Should we commit any changes in the tree here? If we don't
625
625
        # then they will get folded up in to the first merge.
626
626
    except errors.NotBranchError: