158
159
self.assertLogRevnos(['-c1'], ['1'])
161
class TestBug474807(TestLogWithLogCatcher):
162
class TestLogMergedLinearAncestry(TestLogWithLogCatcher):
164
super(TestBug474807, self).setUp()
165
super(TestLogMergedLinearAncestry, self).setUp()
165
166
# FIXME: Using a MemoryTree would be even better here (but until we
166
167
# stop calling run_bzr, there is no point) --vila 100118.
167
168
builder = branchbuilder.BranchBuilder(self.get_transport())
202
203
['1.1.1', '1.1.2', '1.1.3', '1.1.4'])
206
class Test_GenerateAllRevisions(TestLogWithLogCatcher):
208
def make_branch_with_many_merges(self, path='.', format=None):
209
builder = branchbuilder.BranchBuilder(self.get_transport())
210
builder.start_series()
211
# The graph below may look a bit complicated (and it may be but I've
212
# banged my head enough on it) but the bug requires at least dotted
213
# revnos *and* merged revisions below that.
214
builder.build_snapshot('1', None, [
215
('add', ('', 'root-id', 'directory', ''))])
216
builder.build_snapshot('2', ['1'], [])
217
builder.build_snapshot('1.1.1', ['1'], [])
218
builder.build_snapshot('2.1.1', ['2'], [])
219
builder.build_snapshot('3', ['2', '1.1.1'], [])
220
builder.build_snapshot('2.1.2', ['2.1.1'], [])
221
builder.build_snapshot('2.2.1', ['2.1.1'], [])
222
builder.build_snapshot('2.1.3', ['2.1.2', '2.2.1'], [])
223
builder.build_snapshot('4', ['3', '2.1.3'], [])
224
builder.build_snapshot('5', ['4', '2.1.2'], [])
225
builder.finish_series()
228
def test_not_an_ancestor(self):
229
builder = self.make_branch_with_many_merges()
230
b = builder.get_branch()
232
self.addCleanup(b.unlock)
233
self.assertRaises(errors.BzrCommandError,
234
log._generate_all_revisions,
235
b, '1.1.1', '2.1.3', 'reverse',
236
delayed_graph_generation=True)
238
def test_wrong_order(self):
239
builder = self.make_branch_with_many_merges()
240
b = builder.get_branch()
242
self.addCleanup(b.unlock)
243
self.assertRaises(errors.BzrCommandError,
244
log._generate_all_revisions,
245
b, '5', '2.1.3', 'reverse',
246
delayed_graph_generation=True)
205
249
class TestLogRevSpecsWithPaths(TestLogWithLogCatcher):
207
251
def test_log_revno_n_path_wrong_namespace(self):