/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 tests/test_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:
15
15
 
16
16
import os
17
17
 
18
 
from bzrlib import (
 
18
from breezy import (
19
19
        errors,
20
20
        transport,
21
21
        workingtree,
22
22
        )
23
 
from bzrlib.tests import (
 
23
from breezy.tests import (
24
24
        TestCaseInTempDir,
25
25
        TestCaseWithTransport,
26
26
        )
27
 
from bzrlib.plugins.builder.recipe import (
 
27
from breezy.plugins.builder.recipe import (
28
28
        BaseRecipeBranch,
29
29
        build_tree,
30
30
        ensure_basedir,
594
594
    def test_build_tree_merged(self):
595
595
        source1 = self.make_source_branch("source1")
596
596
        source1_rev_id = source1.last_revision()
597
 
        source2 = source1.bzrdir.sprout("source2").open_workingtree()
 
597
        source2 = source1.controldir.sprout("source2").open_workingtree()
598
598
        self.build_tree_contents([("source2/a", "other change")])
599
599
        source2_rev_id = source2.commit("one")
600
600
        base_branch = BaseRecipeBranch("source1", "1", 0.2)
682
682
        # Merge just 'b' from source2; 'a' is untouched.
683
683
        base_branch.nest_part_branch(merged_branch, "b")
684
684
        build_tree(base_branch, "target")
685
 
        file_id = source1.path2id("a")
686
 
        self.check_file_contents("target/a", source1.get_file_text(file_id))
 
685
        self.check_file_contents("target/a", source1.get_file_text('a'))
687
686
        self.check_file_contents("target/b", "new file")
688
687
        self.assertNotInWorkingTree("not-b", "target")
689
688
        self.assertEqual(source1_rev_id, base_branch.revid)
719
718
    def test_build_tree_merge_twice(self):
720
719
        source1 = self.make_source_branch("source1")
721
720
        source1_rev_id = source1.last_revision()
722
 
        source2 = source1.bzrdir.sprout("source2").open_workingtree()
 
721
        source2 = source1.controldir.sprout("source2").open_workingtree()
723
722
        self.build_tree_contents([("source2/a", "other change")])
724
723
        source2_rev_id = source2.commit("one")
725
 
        source3 = source2.bzrdir.sprout("source3").open_workingtree()
 
724
        source3 = source2.controldir.sprout("source3").open_workingtree()
726
725
        self.build_tree_contents([("source3/a", "third change")])
727
726
        source3_rev_id = source3.commit("one")
728
727
        base_branch = BaseRecipeBranch("source1", "1", 0.2)
748
747
 
749
748
    def test_build_tree_merged_with_conflicts(self):
750
749
        source1 = self.make_source_branch("source1")
751
 
        source2 = source1.bzrdir.sprout("source2").open_workingtree()
 
750
        source2 = source1.controldir.sprout("source2").open_workingtree()
752
751
        self.build_tree_contents([("source2/a", "other change\n")])
753
752
        source2_rev_id = source2.commit("one")
754
753
        self.build_tree_contents([("source1/a", "trunk change\n")])
775
774
    def test_build_tree_with_revspecs(self):
776
775
        source1 = self.make_source_branch("source1")
777
776
        source1_rev_id = source1.last_revision()
778
 
        source2 = source1.bzrdir.sprout("source2").open_workingtree()
 
777
        source2 = source1.controldir.sprout("source2").open_workingtree()
779
778
        self.build_tree_contents([("source2/a", "other change\n")])
780
779
        source2_rev_id = source2.commit("one")
781
780
        self.build_tree_contents([("source2/a", "unwanted change\n")])
868
867
        tree_to, br_to = pull_or_branch(None, None, source.branch,
869
868
                to_transport, first_rev_id)
870
869
        tree_to.unlock()
871
 
        tree_to.bzrdir.destroy_workingtree()
 
870
        tree_to.controldir.destroy_workingtree()
872
871
        self.build_tree(["source/b"])
873
872
        source.add(["b"])
874
873
        rev_id = source.commit("two")