~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tag.py

  • Committer: Patch Queue Manager
  • Date: 2016-01-31 13:36:59 UTC
  • mfrom: (6613.1.5 1538480-match-hostname)
  • Revision ID: pqm@pqm.ubuntu.com-20160131133659-ouy92ee2wlv9xz8m
(vila) Use ssl.match_hostname instead of our own. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
 
20
20
from bzrlib import (
21
 
    bzrdir,
 
21
    controldir,
22
22
    errors,
23
23
    )
24
24
from bzrlib.tag import (
26
26
    DisabledTags,
27
27
    )
28
28
from bzrlib.tests import (
29
 
    KnownFailure,
30
29
    TestCase,
31
30
    TestCaseWithTransport,
32
31
    )
70
69
class TestTagMerging(TestCaseWithTransport):
71
70
 
72
71
    def make_knit_branch(self, relpath):
73
 
        old_bdf = bzrdir.format_registry.make_bzrdir('knit')
74
 
        return bzrdir.BzrDir.create_branch_convenience(relpath, format=old_bdf)
 
72
        old_bdf = controldir.format_registry.make_bzrdir('knit')
 
73
        return controldir.ControlDir.create_branch_convenience(relpath, format=old_bdf)
75
74
 
76
75
    def make_branch_supporting_tags(self, relpath):
77
76
        return self.make_branch(relpath, format='dirstate-tags')
110
109
        self.assertRaises(errors.NoSuchTag, a.tags.lookup_tag, 'tag-2')
111
110
        # conflicting merge
112
111
        a.tags.set_tag('tag-2', 'z')
113
 
        conflicts = a.tags.merge_to(b.tags)
114
 
        self.assertEqual(conflicts, [('tag-2', 'z', 'y')])
 
112
        updates, conflicts = a.tags.merge_to(b.tags)
 
113
        self.assertEqual({}, updates)
 
114
        self.assertEqual(list(conflicts), [('tag-2', 'z', 'y')])
115
115
        self.assertEqual('y', b.tags.lookup_tag('tag-2'))
116
116
        # overwrite conflicts
117
 
        conflicts = a.tags.merge_to(b.tags, overwrite=True)
118
 
        self.assertEqual(conflicts, [])
 
117
        updates, conflicts = a.tags.merge_to(b.tags, overwrite=True)
 
118
        self.assertEqual(list(conflicts), [])
 
119
        self.assertEqual({u'tag-2': 'z'}, updates)
119
120
        self.assertEqual('z', b.tags.lookup_tag('tag-2'))
120
121
 
121
122
 
122
123
class TestTagsInCheckouts(TestCaseWithTransport):
 
124
    """Tests for how tags are synchronised between the master and child branch
 
125
    of a checkout.
 
126
    """
123
127
 
124
128
    def test_update_tag_into_checkout(self):
125
129
        # checkouts are directly connected to the tags of their master branch:
165
169
        child.update()
166
170
        # and deletion of tags should also propagate
167
171
        master.tags.delete_tag('foo')
168
 
        raise KnownFailure("tag deletion does not propagate: "
 
172
        self.knownFailure("tag deletion does not propagate: "
169
173
            "https://bugs.launchpad.net/bzr/+bug/138802")
170
174
        self.assertRaises(errors.NoSuchTag,
171
175
            child.tags.lookup_tag, 'foo')