145
145
self._protect_files(root+'/.bzr')
149
# Helper functions to change the above classes into a single function call
151
def make_kernel_like_tree(test, root, link_working=True):
152
"""Setup a temporary tree roughly like a kernel tree.
154
:param url: Creat the kernel like tree as a lightweight checkout
155
of a new branch created at url.
156
:param link_working: instead of creating a new copy of all files
157
just hardlink the working tree. Tests must request this, because
158
they must break links if they want to change the files
160
creator = KernelLikeTreeCreator(test, link_working=link_working)
161
return creator.create(root=root)
164
def make_kernel_like_added_tree(test, root,
167
"""Make a kernel like tree, with all files added
169
:param root: Where to create the files
170
:param link_working: Instead of copying all of the working tree
171
files, just hardlink them to the cached files. Tests can unlink
172
files that they will change.
173
:param hot_cache: Run through the newly created tree and make sure
174
the stat-cache is correct. The old way of creating a freshly
175
added tree always had a hot cache.
177
creator = KernelLikeAddedTreeCreator(test, link_working=link_working,
179
return creator.create(root=root)
182
def make_kernel_like_committed_tree(test, root='.',
186
"""Make a kernel like tree, with all files added and committed
188
:param root: Where to create the files
189
:param link_working: Instead of copying all of the working tree
190
files, just hardlink them to the cached files. Tests can unlink
191
files that they will change.
192
:param link_bzr: Hardlink the .bzr directory. For readonly
193
operations this is safe, and shaves off a lot of setup time
195
creator = KernelLikeCommittedTreeCreator(test,
196
link_working=link_working,
199
return creator.create(root=root)