~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_fetch.py

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for fetch between repositories of the same type."""
18
18
 
19
19
from bzrlib import (
20
 
    bzrdir,
 
20
    controldir,
21
21
    errors,
22
22
    gpg,
23
23
    remote,
24
24
    repository,
25
 
    tests,
26
25
    )
27
26
from bzrlib.inventory import ROOT_ID
28
27
from bzrlib.tests import (
68
67
        tree_a.add('foo', 'file1')
69
68
        tree_a.commit('rev1', rev_id='rev1')
70
69
        # create a knit-3 based format to fetch into
71
 
        f = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
 
70
        f = controldir.format_registry.make_bzrdir('development-subtree')
72
71
        try:
73
72
            format = tree_a.branch.repository._format
74
73
            format.check_conversion_target(f.repository_format)
102
101
                              % b_bzrdir.transport)
103
102
        tree_b.commit('no change', rev_id='rev2')
104
103
        rev2_tree = knit3_repo.revision_tree('rev2')
105
 
        self.assertEqual('rev1', rev2_tree.inventory.root.revision)
 
104
        self.assertEqual(
 
105
            'rev1',
 
106
            rev2_tree.get_file_revision(rev2_tree.get_root_id()))
106
107
 
107
108
    def do_test_fetch_to_rich_root_sets_parents_correctly(self, result,
108
109
        snapshots, root_id=ROOT_ID, allow_lefthand_ghost=False):
336
337
    def test_fetch_into_smart_with_ghost(self):
337
338
        trans = self.make_smart_server('target')
338
339
        source_b = self.make_simple_branch_with_ghost()
 
340
        if not source_b.bzrdir._format.supports_transport(trans):
 
341
            raise TestNotApplicable("format does not support transport")
339
342
        target = self.make_repository('target')
340
343
        # Re-open the repository over the smart protocol
341
344
        target = repository.Repository.open(trans.base)
353
356
    def test_fetch_from_smart_with_ghost(self):
354
357
        trans = self.make_smart_server('source')
355
358
        source_b = self.make_simple_branch_with_ghost()
 
359
        if not source_b.bzrdir._format.supports_transport(trans):
 
360
            raise TestNotApplicable("format does not support transport")
356
361
        target = self.make_repository('target')
357
362
        target.lock_write()
358
363
        self.addCleanup(target.unlock)