Exemple #1
0
 def test_set_stacked_on_url_unstackable_repo(self):
     repo = self.make_repository('a', format='dirstate-tags')
     control = repo.bzrdir
     branch = _mod_branch.BzrBranchFormat7().initialize(control)
     target = self.make_branch('b')
     self.assertRaises(errors.UnstackableRepositoryFormat,
                       branch.set_stacked_on_url, target.base)
 def make_stackable_repo(self, relpath='trunk'):
     if isinstance(self.repository_format, remote.RemoteRepositoryFormat):
         # RemoteRepository by default builds a default format real
         # repository, but the default format is unstackble.  So explicitly
         # make a stackable real repository and use that.
         repo = self.make_repository(relpath, format='1.9')
         dir = controldir.ControlDir.open(self.get_url(relpath))
         repo = dir.open_repository()
     else:
         repo = self.make_repository(relpath)
     if not repo._format.supports_external_lookups:
         raise tests.TestNotApplicable('format not stackable')
     repo.bzrdir._format.set_branch_format(branch.BzrBranchFormat7())
     return repo
Exemple #3
0
 def test_clone_stacked_on_unstackable_repo(self):
     repo = self.make_repository('a', format='dirstate-tags')
     control = repo.bzrdir
     branch = _mod_branch.BzrBranchFormat7().initialize(control)
     # Calling clone should not raise UnstackableRepositoryFormat.
     cloned_bzrdir = control.clone('cloned')