def test_lookup_default(self): default = self.make_branch('.') non_default = default.bzrdir.create_branch(name='nondefault') self.assertEqual( urlutils.join_segment_parameters(default.bzrdir.user_url, {"branch": ""}), directories.dereference('co:'))
def test_no_such_branch(self): # No error is raised in this case, that is up to the code that actually # opens the branch. default = self.make_branch('.') self.assertEqual( urlutils.join_segment_parameters(default.bzrdir.user_url, {"branch": "foo"}), directories.dereference('co:foo'))
def test_sprout_into_colocated(self): # a bzrdir can construct a branch and repository for itself. if not self.bzrdir_format.is_supported(): # unsupported formats are not loopback testable # because the default open will not open them and # they may not be initializable. raise tests.TestNotApplicable('Control dir format not supported') from_tree = self.make_branch_and_tree('from') revid = from_tree.commit("rev1") try: other_branch = self.make_branch("to") except errors.UninitializableFormat: raise tests.TestNotApplicable( 'Control dir does not support creating new branches.') to_dir = from_tree.bzrdir.sprout( urlutils.join_segment_parameters(other_branch.bzrdir.user_url, {"branch": "target"})) to_branch = to_dir.open_branch(name="target") self.assertEqual(revid, to_branch.last_revision())
def test_sprout_into_colocated(self): # a bzrdir can construct a branch and repository for itself. if not self.bzrdir_format.is_supported(): # unsupported formats are not loopback testable # because the default open will not open them and # they may not be initializable. raise tests.TestNotApplicable('Control dir format not supported') from_tree = self.make_branch_and_tree('from') revid = from_tree.commit("rev1") try: other_branch = self.make_branch("to") except errors.UninitializableFormat: raise tests.TestNotApplicable( 'Control dir does not support creating new branches.') to_dir = from_tree.bzrdir.sprout( urlutils.join_segment_parameters( other_branch.bzrdir.user_url, {"branch": "target"})) to_branch = to_dir.open_branch(name="target") self.assertEquals(revid, to_branch.last_revision())
def test_no_such_branch(self): # No error is raised in this case, that is up to the code that actually # opens the branch. default = self.make_branch('.') self.assertEquals(urlutils.join_segment_parameters(default.bzrdir.user_url, {"branch": "foo"}), directories.dereference('co:foo'))
def test_lookup_default(self): default = self.make_branch('.') non_default = default.bzrdir.create_branch(name='nondefault') self.assertEquals(urlutils.join_segment_parameters(default.bzrdir.user_url, {"branch": ""}), directories.dereference('co:'))