~bzr/ubuntu/oneiric/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-04 22:46:16 UTC
  • mfrom: (3815.2547.122)
  • Revision ID: jelmer@samba.org-20111104224616-kvir14wuum69228t
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
        # Clone source into directory
514
514
        target = source_bzrdir.clone(self.get_url('parent/target'))
515
515
 
 
516
    def test_format_initialize_on_transport_ex_stacked_on(self):
 
517
        # trunk is a stackable format.  Note that its in the same server area
 
518
        # which is what launchpad does, but not sufficient to exercise the
 
519
        # general case.
 
520
        trunk = self.make_branch('trunk', format='1.9')
 
521
        t = self.get_transport('stacked')
 
522
        old_fmt = bzrdir.format_registry.make_bzrdir('pack-0.92')
 
523
        repo_name = old_fmt.repository_format.network_name()
 
524
        # Should end up with a 1.9 format (stackable)
 
525
        repo, control, require_stacking, repo_policy = \
 
526
            old_fmt.initialize_on_transport_ex(t,
 
527
                    repo_format_name=repo_name, stacked_on='../trunk',
 
528
                    stack_on_pwd=t.base)
 
529
        if repo is not None:
 
530
            # Repositories are open write-locked
 
531
            self.assertTrue(repo.is_write_locked())
 
532
            self.addCleanup(repo.unlock)
 
533
        else:
 
534
            repo = control.open_repository()
 
535
        self.assertIsInstance(control, bzrdir.BzrDir)
 
536
        opened = bzrdir.BzrDir.open(t.base)
 
537
        if not isinstance(old_fmt, remote.RemoteBzrDirFormat):
 
538
            self.assertEqual(control._format.network_name(),
 
539
                old_fmt.network_name())
 
540
            self.assertEqual(control._format.network_name(),
 
541
                opened._format.network_name())
 
542
        self.assertEqual(control.__class__, opened.__class__)
 
543
        self.assertLength(1, repo._fallback_repositories)
 
544
 
516
545
    def test_sprout_obeys_stacking_policy(self):
517
546
        child_branch, new_child_transport = self.prepare_default_stacking()
518
547
        new_child = child_branch.bzrdir.sprout(new_child_transport.base)
1368
1397
        self._transport.put_bytes("a.~1~", "some content")
1369
1398
        self.assertEqual("a.~2~", self._bzrdir._available_backup_name("a"))
1370
1399
 
 
1400
 
 
1401
class TestMeta1DirColoFormat(TestCaseWithTransport):
 
1402
    """Tests specific to the meta1 dir with colocated branches format."""
 
1403
 
 
1404
    def test_supports_colo(self):
 
1405
        format = bzrdir.BzrDirMetaFormat1Colo()
 
1406
        self.assertTrue(format.colocated_branches)