159
158
self.assertLogRevnos(['-c1'], ['1'])
162
class TestLogMergedLinearAncestry(TestLogWithLogCatcher):
161
class TestBug474807(TestLogWithLogCatcher):
165
super(TestLogMergedLinearAncestry, self).setUp()
164
super(TestBug474807, self).setUp()
166
165
# FIXME: Using a MemoryTree would be even better here (but until we
167
166
# stop calling run_bzr, there is no point) --vila 100118.
168
167
builder = branchbuilder.BranchBuilder(self.get_transport())
203
202
['1.1.1', '1.1.2', '1.1.3', '1.1.4'])
206
class Test_GenerateAllRevisions(TestLogWithLogCatcher):
209
super(Test_GenerateAllRevisions, self).setUp()
210
builder = self.make_branch_with_many_merges()
211
b = builder.get_branch()
213
self.addCleanup(b.unlock)
216
def make_branch_with_many_merges(self, path='.', format=None):
217
builder = branchbuilder.BranchBuilder(self.get_transport())
218
builder.start_series()
219
# The graph below may look a bit complicated (and it may be but I've
220
# banged my head enough on it) but the bug requires at least dotted
221
# revnos *and* merged revisions below that.
222
builder.build_snapshot('1', None, [
223
('add', ('', 'root-id', 'directory', ''))])
224
builder.build_snapshot('2', ['1'], [])
225
builder.build_snapshot('1.1.1', ['1'], [])
226
builder.build_snapshot('2.1.1', ['2'], [])
227
builder.build_snapshot('3', ['2', '1.1.1'], [])
228
builder.build_snapshot('2.1.2', ['2.1.1'], [])
229
builder.build_snapshot('2.2.1', ['2.1.1'], [])
230
builder.build_snapshot('2.1.3', ['2.1.2', '2.2.1'], [])
231
builder.build_snapshot('4', ['3', '2.1.3'], [])
232
builder.build_snapshot('5', ['4', '2.1.2'], [])
233
builder.finish_series()
236
def test_not_an_ancestor(self):
237
self.assertRaises(errors.BzrCommandError,
238
log._generate_all_revisions,
239
self.branch, '1.1.1', '2.1.3', 'reverse',
240
delayed_graph_generation=True)
242
def test_wrong_order(self):
243
self.assertRaises(errors.BzrCommandError,
244
log._generate_all_revisions,
245
self.branch, '5', '2.1.3', 'reverse',
246
delayed_graph_generation=True)
248
def test_no_start_rev_id_with_end_rev_id_being_a_merge(self):
249
revs = log._generate_all_revisions(
250
self.branch, None, '2.1.3',
251
'reverse', delayed_graph_generation=True)
254
205
class TestLogRevSpecsWithPaths(TestLogWithLogCatcher):
256
207
def test_log_revno_n_path_wrong_namespace(self):
365
317
'options are "utc", "original", "local".'],
366
318
['log', '--timezone', 'foo'])
368
def test_log_exclude_ancestry_no_range(self):
369
self.make_linear_branch()
370
self.run_bzr_error(['bzr: ERROR: --exclude-common-ancestry'
371
' requires -r with two revisions'],
372
['log', '--exclude-common-ancestry'])
374
def test_log_exclude_ancestry_single_revision(self):
375
self.make_merged_branch()
376
self.run_bzr_error(['bzr: ERROR: --exclude-common-ancestry'
377
' requires two different revisions'],
378
['log', '--exclude-common-ancestry',
381
321
class TestLogTags(TestLog):