127
127
creator = HeavilyMergedTreeCreator(self, link_bzr=hardlink)
128
128
return creator.create(root=directory_name)
130
def create_with_commits(self, num_files, num_commits, directory_name='.'):
130
def create_with_commits(self, num_files, num_commits, directory_name='.',
131
132
"""Create a tree with many files and many commits. Every commit changes
132
133
exactly one file.
134
135
:param num_files: number of files to be created
135
136
:param num_commits: number of commits in the newly created tree
137
files = ["%s/%s" % (directory_name, i) for i in range(num_files)]
141
f.write("some content\n")
144
tree = bzrdir.BzrDir.create_standalone_workingtree(directory_name)
145
tree.add([str(i) for i in range(num_files)])
148
tree.commit('initial commit')
149
for i in range(num_commits):
150
fn = files[i % len(files)]
151
content = range(i) + [i, i, i, ""]
154
f.write("\n".join([str(i) for i in content]))
157
tree.commit("changing file %s" % fn)
138
from bzrlib.benchmarks.tree_creator.many_commit import (
139
ManyCommitTreeCreator,
141
creator = ManyCommitTreeCreator(self, link_bzr=hardlink,
143
num_commits=num_commits)
144
tree = creator.create(root=directory_name)
145
files = ["%s/%s" % (directory_name, fn) for fn in creator.files]
160
146
return tree, files
162
148
def commit_some_revisions(self, tree, files, num_commits,
187
173
testmod_names = [ \
188
174
'bzrlib.benchmarks.bench_add',
189
175
'bzrlib.benchmarks.bench_bench',
176
'bzrlib.benchmarks.bench_bundle',
190
177
'bzrlib.benchmarks.bench_cache_utf8',
191
178
'bzrlib.benchmarks.bench_checkout',
192
179
'bzrlib.benchmarks.bench_commit',
180
'bzrlib.benchmarks.bench_info',
193
181
'bzrlib.benchmarks.bench_inventory',
194
182
'bzrlib.benchmarks.bench_log',
195
183
'bzrlib.benchmarks.bench_osutils',
196
184
'bzrlib.benchmarks.bench_rocks',
185
'bzrlib.benchmarks.bench_startup',
197
186
'bzrlib.benchmarks.bench_status',
198
187
'bzrlib.benchmarks.bench_transform',
199
188
'bzrlib.benchmarks.bench_workingtree',