~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

Merge pt1 hooks branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    branch,
26
 
    branchbuilder,
27
26
    bzrdir,
28
27
    conflicts,
29
28
    merge_directive,
625
624
            tree.revert()
626
625
            self.failUnlessExists("a")
627
626
 
 
627
    def test_merge_fetches_tags(self):
 
628
        """Tags are updated by merge, and revisions named in those tags are
 
629
        fetched.
 
630
        """
 
631
        # Make a source, sprout a target off it
 
632
        builder = self.make_branch_builder('source')
 
633
        builder.build_commit(message="Rev 1", rev_id='rev-1')
 
634
        source = builder.get_branch()
 
635
        target_bzrdir = source.bzrdir.sprout('target')
 
636
        # Add a non-ancestry tag to source
 
637
        builder.build_commit(message="Rev 2a", rev_id='rev-2a')
 
638
        source.tags.set_tag('tag-a', 'rev-2a')
 
639
        source.set_last_revision_info(1, 'rev-1')
 
640
        builder.build_commit(message="Rev 2b", rev_id='rev-2b')
 
641
        # Merge from source
 
642
        self.run_bzr('merge -d target source')
 
643
        target = target_bzrdir.open_branch()
 
644
        # The tag is present, and so is its revision.
 
645
        self.assertEqual('rev-2a', target.tags.lookup_tag('tag-a'))
 
646
        target.repository.get_revision('rev-2a')
 
647
 
628
648
 
629
649
class TestMergeForce(tests.TestCaseWithTransport):
630
650