825
825
def test_sprout_recursive(self):
826
826
tree = self.make_branch_and_tree('tree1',
827
format='dirstate-with-subtree')
827
format='development-subtree')
828
828
sub_tree = self.make_branch_and_tree('tree1/subtree',
829
format='dirstate-with-subtree')
829
format='development-subtree')
830
830
sub_tree.set_root_id('subtree-root')
831
831
tree.add_reference(sub_tree)
832
832
self.build_tree(['tree1/subtree/file'])
850
850
def test_sprout_recursive_treeless(self):
851
851
tree = self.make_branch_and_tree('tree1',
852
format='dirstate-with-subtree')
852
format='development-subtree')
853
853
sub_tree = self.make_branch_and_tree('tree1/subtree',
854
format='dirstate-with-subtree')
854
format='development-subtree')
855
855
tree.add_reference(sub_tree)
856
856
self.build_tree(['tree1/subtree/file'])
857
857
sub_tree.add('file')
858
858
tree.commit('Initial commit')
859
859
# The following line force the orhaning to reveal bug #634470
860
tree.branch.get_config().set_user_option(
860
tree.branch.get_config_stack().set(
861
861
'bzr.transform.orphan_policy', 'move')
862
862
tree.bzrdir.destroy_workingtree()
863
863
# FIXME: subtree/.bzr is left here which allows the test to pass (or
864
864
# fail :-( ) -- vila 20100909
865
865
repo = self.make_repository('repo', shared=True,
866
format='dirstate-with-subtree')
866
format='development-subtree')
867
867
repo.set_make_working_trees(False)
868
868
# FIXME: we just deleted the workingtree and now we want to use it ????
869
869
# At a minimum, we should use tree.branch below (but this fails too
1021
1021
otherdir = bzrdir.format_registry.make_bzrdir('knit')
1022
1022
self.assertEqual(otherdir, mydir)
1023
1023
self.assertFalse(otherdir != mydir)
1024
otherdir2 = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
1024
otherdir2 = bzrdir.format_registry.make_bzrdir('development-subtree')
1025
1025
self.assertNotEqual(otherdir2, mydir)
1026
1026
self.assertFalse(otherdir2 == mydir)
1447
1447
tree.bzrdir.create_branch(name="another-colocated-branch")
1448
1448
converter = tree.bzrdir._format.get_converter(
1449
1449
bzrdir.BzrDirMetaFormat1())
1450
self.assertRaises(errors.BzrError, converter.convert, tree.bzrdir,
1450
result = converter.convert(tree.bzrdir, bzrdir.BzrDirMetaFormat1())
1451
self.assertIsInstance(result._format, bzrdir.BzrDirMetaFormat1)
1453
def test_nested(self):
1454
tree = self.make_branch_and_tree('.', format='development-colo')
1455
tree.bzrdir.create_branch(name='foo')
1456
tree.bzrdir.create_branch(name='fool/bla')
1458
errors.ParentBranchExists, tree.bzrdir.create_branch,
1461
def test_parent(self):
1462
tree = self.make_branch_and_tree('.', format='development-colo')
1463
tree.bzrdir.create_branch(name='fool/bla')
1464
tree.bzrdir.create_branch(name='foo/bar')
1466
errors.AlreadyBranchError, tree.bzrdir.create_branch,
1454
1470
class SampleBzrFormat(bzrdir.BzrFormat):