~jelmer/ubuntu/maverick/bzr/2.2.5

« back to all changes in this revision

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

ImportĀ upstreamĀ versionĀ 1.13~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
 
35
35
class TestLegacyFormats(TestCaseWithTransport):
36
 
    
 
36
 
37
37
    def setUp(self):
38
38
        super(TestLegacyFormats, self).setUp()
39
39
        self.build_tree(['master/', 'child/'])
41
41
        self.make_branch_and_tree('child',
42
42
                        format=bzrdir.format_registry.make_bzrdir('weave'))
43
43
        os.chdir('child')
44
 
    
 
44
 
45
45
    def test_bind_format_6_bzrdir(self):
46
46
        # bind on a format 6 bzrdir should error
47
47
        out,err = self.run_bzr('bind ../master', retcode=3)
51
51
        cwd = urlutils.local_path_to_url(getcwd())
52
52
        self.assertEqual('bzr: ERROR: To use this feature you must '
53
53
                         'upgrade your branch at %s/.\n' % cwd, err)
54
 
    
 
54
 
55
55
    def test_unbind_format_6_bzrdir(self):
56
56
        # bind on a format 6 bzrdir should error
57
57
        out,err = self.run_bzr('unbind', retcode=3)
284
284
        self.check_revno(1)
285
285
 
286
286
    def test_bind_child_ahead(self):
287
 
        # test binding when the master branches history is a prefix of the 
 
287
        # test binding when the master branches history is a prefix of the
288
288
        # childs - it should bind ok but the revision histories should not
289
289
        # be altered
290
290
        child_tree = self.create_branches()[1]
317
317
                            working_dir='tree_1')
318
318
        self.assertIs(None, tree.branch.get_bound_location())
319
319
 
 
320
    def test_bind_nick(self):
 
321
        """Bind should not update implicit nick."""
 
322
        base = self.make_branch_and_tree('base')
 
323
        child = self.make_branch_and_tree('child')
 
324
        os.chdir('child')
 
325
        self.assertEqual(child.branch.nick, 'child')
 
326
        self.assertEqual(child.branch.get_config().has_explicit_nickname(),
 
327
            False)
 
328
        self.run_bzr('bind ../base')
 
329
        self.assertEqual(child.branch.nick, base.branch.nick)
 
330
        self.assertEqual(child.branch.get_config().has_explicit_nickname(),
 
331
            False)
 
332
 
 
333
    def test_bind_explicit_nick(self):
 
334
        """Bind should update explicit nick."""
 
335
        base = self.make_branch_and_tree('base')
 
336
        child = self.make_branch_and_tree('child')
 
337
        os.chdir('child')
 
338
        child.branch.nick = "explicit_nick"
 
339
        self.assertEqual(child.branch.nick, "explicit_nick")
 
340
        self.assertEqual(child.branch.get_config()._get_explicit_nickname(),
 
341
            "explicit_nick")
 
342
        self.run_bzr('bind ../base')
 
343
        self.assertEqual(child.branch.nick, base.branch.nick)
 
344
        self.assertEqual(child.branch.get_config()._get_explicit_nickname(),
 
345
            base.branch.nick)
 
346
 
320
347
    def test_commit_after_merge(self):
321
348
        base_tree, child_tree = self.create_branches()
322
349