~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_tree/__init__.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:
29
29
    errors,
30
30
    tests,
31
31
    transform,
 
32
    transport,
32
33
    )
33
34
from bzrlib.tests.per_controldir.test_controldir import TestCaseWithControlDir
34
35
from bzrlib.tests.per_workingtree import (
99
100
class TestCaseWithTree(TestCaseWithControlDir):
100
101
 
101
102
    def make_branch_and_tree(self, relpath):
102
 
        made_control = self.make_bzrdir(relpath, format=
103
 
            self.workingtree_format._matchingbzrdir)
 
103
        bzrdir_format = self.workingtree_format.get_controldir_for_branch()
 
104
        made_control = self.make_bzrdir(relpath, format=bzrdir_format)
104
105
        made_control.create_repository()
105
 
        made_control.create_branch()
106
 
        return self.workingtree_format.initialize(made_control)
 
106
        b = made_control.create_branch()
 
107
        if getattr(self, 'repo_is_remote', False):
 
108
            # If the repo is remote, then we just create a local lightweight
 
109
            # checkout
 
110
            # XXX: This duplicates a lot of Branch.create_checkout, but we know
 
111
            #      we want a) lightweight, and b) a specific WT format. We also
 
112
            #      know that nothing should already exist, etc.
 
113
            t = transport.get_transport(relpath)
 
114
            t.ensure_base()
 
115
            wt_dir = bzrdir_format.initialize_on_transport(t)
 
116
            branch_ref = wt_dir.set_branch_reference(b)
 
117
            wt = wt_dir.create_workingtree(None, from_branch=branch_ref)
 
118
        else:
 
119
            wt = self.workingtree_format.initialize(made_control)
 
120
        return wt
107
121
 
108
122
    def workingtree_to_test_tree(self, tree):
109
123
        return self._workingtree_to_test_tree(self, tree)
382
396
        'get_file_with_stat',
383
397
        'get_root_id',
384
398
        'get_symlink_target',
 
399
        'ids',
385
400
        'inv',
386
401
        'iter_search_rules',
387
402
        'is_executable',