Exemple #1
0
 def make_branch_with_many_merges(self, path='.', format=None):
     builder = branchbuilder.BranchBuilder(self.get_transport())
     builder.start_series()
     # The graph below may look a bit complicated (and it may be but I've
     # banged my head enough on it) but the bug requires at least dotted
     # revnos *and* merged revisions below that.
     # 1
     # | \
     # 2  1.1.1
     # | X
     # 3  2.1.1
     # |   |    \
     # |  2.1.2  2.2.1
     # |   |    X
     # |  2.1.3  \
     # | /       /
     # 4        /
     # |       /
     # 5 -----/
     builder.build_snapshot(None,
                            [('add', ('', b'root-id', 'directory', ''))],
                            revision_id=b'1')
     builder.build_snapshot([b'1'], [], revision_id=b'2')
     builder.build_snapshot([b'1'], [], revision_id=b'1.1.1')
     builder.build_snapshot([b'2'], [], revision_id=b'2.1.1')
     builder.build_snapshot([b'2', b'1.1.1'], [], revision_id=b'3')
     builder.build_snapshot([b'2.1.1'], [], revision_id=b'2.1.2')
     builder.build_snapshot([b'2.1.1'], [], revision_id=b'2.2.1')
     builder.build_snapshot([b'2.1.2', b'2.2.1'], [], revision_id=b'2.1.3')
     builder.build_snapshot([b'3', b'2.1.3'], [], revision_id=b'4')
     builder.build_snapshot([b'4', b'2.1.2'], [], revision_id=b'5')
     builder.finish_series()
     return builder
 def create_branch(self, bzrdir, name=None):
     branch = bzrdir.create_branch(name=name)
     # Create a commit on the branch, just because some formats
     # have nascent branches that don't hit disk.
     bb = branchbuilder.BranchBuilder(branch=branch)
     bb.build_commit()
     return branch
Exemple #3
0
    def setUp(self):
        super(TestLogMergedLinearAncestry, self).setUp()
        # FIXME: Using a MemoryTree would be even better here (but until we
        # stop calling run_bzr, there is no point) --vila 100118.
        builder = branchbuilder.BranchBuilder(self.get_transport())
        builder.start_series()
        # 1
        # | \
        # 2  1.1.1
        # | / |
        # 3  1.1.2
        # |   |
        # |  1.1.3
        # | / |
        # 4  1.1.4
        # | /
        # 5
        # | \
        # | 5.1.1
        # | /
        # 6

        # mainline
        builder.build_snapshot(None,
                               [('add', ('', b'root-id', 'directory', ''))],
                               revision_id=b'1')
        builder.build_snapshot([b'1'], [], revision_id=b'2')
        # branch
        builder.build_snapshot([b'1'], [], revision_id=b'1.1.1')
        # merge branch into mainline
        builder.build_snapshot([b'2', b'1.1.1'], [], revision_id=b'3')
        # new commits in branch
        builder.build_snapshot([b'1.1.1'], [], revision_id=b'1.1.2')
        builder.build_snapshot([b'1.1.2'], [], revision_id=b'1.1.3')
        # merge branch into mainline
        builder.build_snapshot([b'3', b'1.1.3'], [], revision_id=b'4')
        # merge mainline into branch
        builder.build_snapshot([b'1.1.3', b'4'], [], revision_id=b'1.1.4')
        # merge branch into mainline
        builder.build_snapshot([b'4', b'1.1.4'], [], revision_id=b'5')
        builder.build_snapshot([b'5'], [], revision_id=b'5.1.1')
        builder.build_snapshot([b'5', b'5.1.1'], [], revision_id=b'6')
        builder.finish_series()
Exemple #4
0
 def make_branch_builder(self, relpath, format=None):
     if format is None:
         format = self.workingtree_format.get_controldir_for_branch()
     builder = branchbuilder.BranchBuilder(self.get_transport(relpath),
                                           format=format)
     return builder
Exemple #5
0
 def make_from_branch_builder(self, relpath):
     self.assertEqual(
         self.branch_format_from._matchingcontroldir.get_branch_format(),
         self.branch_format_from)
     return branchbuilder.BranchBuilder(self.get_transport(relpath),
                                        format=self.branch_format_from._matchingcontroldir)