~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-15 03:19:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1923.
  • Revision ID: john@arbash-meinel.com-20060815031949-3a28a6d6a9388586
I think it is actually better as simple helper functions on Benchmark

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
                                        url=url)
43
43
        return creator.create(root=root)
44
44
 
 
45
    def make_kernel_like_added_tree(self, root='.',
 
46
                                    link_working=True,
 
47
                                    hot_cache=True):
 
48
        """Make a kernel like tree, with all files added
 
49
 
 
50
        :param root: Where to create the files
 
51
        :param link_working: Instead of copying all of the working tree
 
52
            files, just hardlink them to the cached files. Tests can unlink
 
53
            files that they will change.
 
54
        :param hot_cache: Run through the newly created tree and make sure
 
55
            the stat-cache is correct. The old way of creating a freshly
 
56
            added tree always had a hot cache.
 
57
        """
 
58
        from bzrlib.benchmarks.tree_creator.kernel_like import (
 
59
            KernelLikeAddedTreeCreator,
 
60
            )
 
61
        creator = KernelLikeAddedTreeCreator(self, link_working=link_working,
 
62
                                             hot_cache=hot_cache)
 
63
        return creator.create(root=root)
 
64
 
 
65
    def make_kernel_like_committed_tree(self, root='.',
 
66
                                    link_working=True,
 
67
                                    link_bzr=False,
 
68
                                    hot_cache=True):
 
69
        """Make a kernel like tree, with all files added and committed
 
70
 
 
71
        :param root: Where to create the files
 
72
        :param link_working: Instead of copying all of the working tree
 
73
            files, just hardlink them to the cached files. Tests can unlink
 
74
            files that they will change.
 
75
        :param link_bzr: Hardlink the .bzr directory. For readonly 
 
76
            operations this is safe, and shaves off a lot of setup time
 
77
        """
 
78
        from bzrlib.benchmarks.tree_creator.kernel_like import (
 
79
            KernelLikeCommittedTreeCreator,
 
80
            )
 
81
        creator = KernelLikeCommittedTreeCreator(self,
 
82
                                                 link_working=link_working,
 
83
                                                 link_bzr=link_bzr,
 
84
                                                 hot_cache=hot_cache)
 
85
        return creator.create(root=root)
 
86
 
45
87
    def make_many_commit_tree(self, directory_name='.',
46
88
                              hardlink=False):
47
89
        """Create a tree with many commits.