302
306
log_contents = logfile.read()
303
307
self.assertEqualDiff(log_contents, '1: Line-Log-Formatte... 2005-11-23 add a\n')
309
def test_get_view_revisions(self):
310
"""Test the get_view_revisions method"""
311
wt = self.make_branch_and_tree('tree1')
312
wt.commit('commit one', rev_id='1')
313
wt.commit('commit two', rev_id='2')
314
wt.commit('commit three', rev_id='3')
315
mainline_revs = [None, '1', '2', '3']
316
rev_nos = {'1': 1, '2': 2, '3': 3, '4b': 4}
317
revisions = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
319
self.assertEqual(revisions, [('1', 1, 0), ('2', 2, 0), ('3', 3, 0)])
320
revisions2 = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
321
'forward', no_merges=True))
322
self.assertEqual(revisions, revisions2)
323
revisions = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
325
self.assertEqual(revisions, [('3', 3, 0), ('2', 2, 0), ('1', 1, 0), ])
326
revisions2 = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
327
'reverse', no_merges=True))
328
self.assertEqual(revisions, revisions2)
329
tree2 = wt.bzrdir.sprout('tree2').open_workingtree()
330
tree2.commit('four-a', rev_id='4a')
331
wt.branch.fetch(tree2.branch, '4a')
332
wt.add_pending_merge('4a')
333
wt.commit('four-b', rev_id='4b')
334
mainline_revs.append('4b')
335
revisions = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
337
self.assertEqual(revisions, [('1', 1, 0), ('2', 2, 0), ('3', 3, 0),
338
('4a', None, 1), ('4b', 4, 0)])
339
revisions = list(get_view_revisions(mainline_revs, rev_nos, wt.branch,
340
'forward', no_merges=True))
341
self.assertEqual(revisions, [('1', 1, 0), ('2', 2, 0), ('3', 3, 0),