Exemplo n.º 1
0
 def test_eq(self):
     format1 = HgControlDirFormat()
     format2 = HgControlDirFormat()
     self.assertEquals(format1, format2)
     self.assertEquals(format1, format1)
     bzr_format = format_registry.make_controldir("default")
     self.assertNotEquals(bzr_format, format1)
Exemplo n.º 2
0
    def test_svn_import_format(self):
        svn_url = self.make_repository('d')

        self.run_bzr('svn-import --format 1.9-rich-root %s dc' % svn_url)
        cd = ControlDir.open('dc')
        self.assertEquals(
            cd.open_repository()._format,
            format_registry.make_controldir('1.9-rich-root').repository_format)
Exemplo n.º 3
0
    def test_shared_import_old_repos_fails(self):
        dir = ControlDir.create("e",
                                format=format_registry.make_controldir('knit'))
        dir.create_repository(shared=True)

        self.assertRaises(
            IncompatibleRepositories,
            lambda: convert_repository(Repository.open(self.repos_url),
                                       "e",
                                       TrunkLayout(0),
                                       create_shared_repo=True,
                                       working_trees=False))
Exemplo n.º 4
0
 def _get_checkout_format(self, lightweight=False):
     from .workingtree import SvnWorkingTreeDirFormat
     if lightweight:
         return SvnWorkingTreeDirFormat()
     else:
         return format_registry.make_controldir('default')
Exemplo n.º 5
0
 def cloning_metadir(self, require_stacking=False, require_colocated=False):
     """Produce a metadir suitable for cloning with."""
     ret = format_registry.make_controldir('default')
     if require_colocated and not ret.colocated_branches:
         ret = format_registry.make_controldir('development-colo')
     return ret
Exemplo n.º 6
0
 def test_conversion_target_compatible(self):
     self.format.check_conversion_target(
         format_registry.make_controldir('rich-root').repository_format)
Exemplo n.º 7
0
 def test_conversion_target_incompatible(self):
     self.assertRaises(
         BadConversionTarget, self.format.check_conversion_target,
         format_registry.make_controldir('weave').repository_format)
Exemplo n.º 8
0
 def test_needs_format_upgrade_default(self):
     repos_url = self.make_svn_repository("d")
     x = ControlDir.open(repos_url + "/trunk")
     self.assertTrue(
         x.needs_format_conversion(
             format_registry.make_controldir("default")))
Exemplo n.º 9
0
 def test_hash(self):
     format1 = HgControlDirFormat()
     format2 = HgControlDirFormat()
     self.assertEquals(hash(format1), hash(format2))
     bzr_format = format_registry.make_controldir("default")
     self.assertNotEquals(hash(bzr_format), hash(format1))
Exemplo n.º 10
0
 def test_needs_format_conversion_default(self):
     self.make_svn_branch_and_tree("d", "dc")
     x = ControlDir.open("dc")
     self.assertTrue(x.needs_format_conversion(
         format_registry.make_controldir('default')))
Exemplo n.º 11
0
 def test_get_converter(self):
     convert = self.format.get_converter(
         format_registry.make_controldir('default'))