18
18
"""Tests of bound branches (binding, unbinding, commit, etc) command."""
21
from cStringIO import StringIO
23
22
from bzrlib import (
28
26
from bzrlib.branch import Branch
29
from bzrlib.bzrdir import (BzrDir, BzrDirFormat, BzrDirMetaFormat1)
30
from bzrlib.osutils import getcwd
27
from bzrlib.bzrdir import BzrDir
31
28
from bzrlib.tests import script
32
import bzrlib.urlutils as urlutils
33
from bzrlib.workingtree import WorkingTree
36
class TestLegacyFormats(tests.TestCaseWithTransport):
39
super(TestLegacyFormats, self).setUp()
40
self.build_tree(['master/', 'child/'])
41
self.make_branch_and_tree('master')
42
self.make_branch_and_tree('child',
43
format=bzrdir.format_registry.make_bzrdir('weave'))
46
def test_bind_format_6_bzrdir(self):
47
# bind on a format 6 bzrdir should error
48
out,err = self.run_bzr('bind ../master', retcode=3)
49
self.assertEqual('', out)
50
# TODO: jam 20060427 Probably something like this really should
51
# print out the actual path, rather than the URL
52
cwd = urlutils.local_path_to_url(getcwd())
53
self.assertEqual('bzr: ERROR: To use this feature you must '
54
'upgrade your branch at %s/.\n' % cwd, err)
56
def test_unbind_format_6_bzrdir(self):
57
# bind on a format 6 bzrdir should error
58
out,err = self.run_bzr('unbind', retcode=3)
59
self.assertEqual('', out)
60
cwd = urlutils.local_path_to_url(getcwd())
61
self.assertEqual('bzr: ERROR: To use this feature you must '
62
'upgrade your branch at %s/.\n' % cwd, err)
65
31
class TestBoundBranches(tests.TestCaseWithTransport):