96
100
class TestCaseWithTree(TestCaseWithControlDir):
98
102
def make_branch_and_tree(self, relpath):
99
made_control = self.make_bzrdir(relpath, format=
100
self.workingtree_format._matchingbzrdir)
103
bzrdir_format = self.workingtree_format.get_controldir_for_branch()
104
made_control = self.make_bzrdir(relpath, format=bzrdir_format)
101
105
made_control.create_repository()
102
made_control.create_branch()
103
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
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)
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)
119
wt = self.workingtree_format.initialize(made_control)
105
122
def workingtree_to_test_tree(self, tree):
106
123
return self._workingtree_to_test_tree(self, tree)
242
259
note that the order of the paths and fileids is deliberately
243
260
mismatched to ensure that the result order is path based.
245
self.requireFeature(tests.UnicodeFilenameFeature)
262
self.requireFeature(features.UnicodeFilenameFeature)
246
263
tree = self.make_branch_and_tree('.')
247
264
paths = ['0file',
275
292
def _create_tree_with_utf8(self, tree):
276
293
"""Generate a tree with a utf8 revision and unicode paths."""
277
self.requireFeature(tests.UnicodeFilenameFeature)
294
self.requireFeature(features.UnicodeFilenameFeature)
278
295
# We avoid combining characters in file names here, normalization
279
296
# checks (as performed by some file systems (OSX) are outside the scope
280
297
# of these tests). We use the euro sign \N{Euro Sign} or \u20ac in