b.b.t.TreeCreator(object) : class documentation

Part of bzrlib.benchmarks.tree_creator View In Hierarchy

Known subclasses: bzrlib.benchmarks.tree_creator.heavily_merged.HeavilyMergedTreeCreator, bzrlib.benchmarks.tree_creator.kernel_like.KernelLikeAddedTreeCreator, bzrlib.benchmarks.tree_creator.kernel_like.KernelLikeCommittedTreeCreator, bzrlib.benchmarks.tree_creator.kernel_like.KernelLikeInventoryCreator, bzrlib.benchmarks.tree_creator.kernel_like.KernelLikeTreeCreator, bzrlib.benchmarks.tree_creator.many_commit.ManyCommitTreeCreator, bzrlib.benchmarks.tree_creator.simple_many_commit.SimpleManyCommitTreeCreator

Just a basic class which is used to create various test trees
Method __init__ Instantiate a new creator object, supply the id of the tree
Method is_caching_enabled Will we try to cache the tree we create?
Method is_cached Is this tree already cached?
Method disable_cache Do not use the cache
Method ensure_cached If caching, make sure the cached copy exists
Method create Create a new tree at 'root'.
Method _get_cache_dir Get the directory to use for caching this tree
Method _create_tree Create the desired tree in the given location.
Method _clone_cached_tree Copy the contents of the cached dir into the destination
Method _protect_files Chmod all files underneath 'root' to prevent writing
def __init__(self, test, tree_name, link_bzr=False, link_working=False, hot_cache=True):
Instantiate a new creator object, supply the id of the tree
ParameterstestA TestCaseWithTransport object (most creators need we need the build_tree functionality)
def is_caching_enabled(self):
Will we try to cache the tree we create?
def is_cached(self):
Is this tree already cached?
def disable_cache(self):
Do not use the cache
def ensure_cached(self):
If caching, make sure the cached copy exists
def create(self, root):
Create a new tree at 'root'.
ReturnsA WorkingTree object.
def _get_cache_dir(self):
Get the directory to use for caching this tree
ReturnsThe path to use for caching. If None, caching is disabled
def _create_tree(self, root, in_cache=False):
Create the desired tree in the given location.

Children should override this function to provide the actual creation of the desired tree. This will be called by 'create()'. If it is building a tree in the cache, before copying it to the real target, it will pass in_cache=True

def _clone_cached_tree(self, dest):
Copy the contents of the cached dir into the destination Optionally hardlink certain pieces of the tree.

This is just meant as a helper function for child classes

ParametersdestThe destination to copy things to
def _protect_files(self, root):
Chmod all files underneath 'root' to prevent writing

This is a helper function for child classes.

ParametersrootThe base directory to modify
API Documentation for Bazaar, generated by pydoctor at 2010-08-03 00:12:18.