186
186
tree1.commit('noop merge', rev_id='rev-4')
188
188
self.build_tree_contents([('tree3/a', 'first\nthird\nfourth\n')])
189
tree3.commit('four', rev_id='rev-1_1_1_1_1',
189
tree3.commit('four', rev_id='rev-1_2_1',
190
190
committer='jerry@foo.com',
191
191
timestamp=1166046003.00, timezone=0)
193
193
tree4 = tree3.bzrdir.clone('tree4').open_workingtree()
195
tree3.commit('noop', rev_id='rev-1_1_1_1_2',
195
tree3.commit('noop', rev_id='rev-1_2_2',
196
196
committer='jerry@foo.com',
197
197
timestamp=1166046004.00, timezone=0)
198
198
self.assertEqual(0, tree1.merge_from_branch(tree3.branch))
201
201
self.build_tree_contents([('tree4/a',
202
202
'first\nthird\nfourth\nfifth\nsixth\n')])
203
tree4.commit('five and six', rev_id='rev-1_1_1_1_1_1_1',
203
tree4.commit('five and six', rev_id='rev-1_3_1',
204
204
committer='george@foo.com',
205
205
timestamp=1166046005.00, timezone=0)
206
206
self.assertEqual(0, tree1.merge_from_branch(tree4.branch))
227
227
annotate.annotate_file(tree1.branch, 'rev-6', 'a-id',
228
228
to_file=sio, verbose=False, full=False)
229
self.assertEqualDiff('1 joe@foo | first\n'
230
'2 joe@foo | second\n'
231
'1.1.1 barry@f | third\n'
232
'1.1.1.1.1 jerry@f | fourth\n'
233
'1.1.1.1.1.1> george@ | fifth\n'
229
self.assertEqualDiff('1 joe@foo | first\n'
230
'2 joe@foo | second\n'
231
'1.1.1 barry@f | third\n'
232
'1.2.1 jerry@f | fourth\n'
233
'1.3.1 george@ | fifth\n'
238
238
annotate.annotate_file(tree1.branch, 'rev-6', 'a-id',
239
239
to_file=sio, verbose=False, full=True)
240
self.assertEqualDiff('1 joe@foo | first\n'
241
'2 joe@foo | second\n'
242
'1.1.1 barry@f | third\n'
243
'1.1.1.1.1 jerry@f | fourth\n'
244
'1.1.1.1.1.1> george@ | fifth\n'
245
'1.1.1.1.1.1> george@ | sixth\n',
240
self.assertEqualDiff('1 joe@foo | first\n'
241
'2 joe@foo | second\n'
242
'1.1.1 barry@f | third\n'
243
'1.2.1 jerry@f | fourth\n'
244
'1.3.1 george@ | fifth\n'
245
'1.3.1 george@ | sixth\n',
248
248
# verbose=True shows everything, the full revno, user id, and date
250
250
annotate.annotate_file(tree1.branch, 'rev-6', 'a-id',
251
251
to_file=sio, verbose=True, full=False)
252
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
253
'2 joe@foo.com 20061213 | second\n'
254
'1.1.1 barry@foo.com 20061213 | third\n'
255
'1.1.1.1.1 jerry@foo.com 20061213 | fourth\n'
256
'1.1.1.1.1.1.1 george@foo.com 20061213 | fifth\n'
252
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
253
'2 joe@foo.com 20061213 | second\n'
254
'1.1.1 barry@foo.com 20061213 | third\n'
255
'1.2.1 jerry@foo.com 20061213 | fourth\n'
256
'1.3.1 george@foo.com 20061213 | fifth\n'
261
261
annotate.annotate_file(tree1.branch, 'rev-6', 'a-id',
262
262
to_file=sio, verbose=True, full=True)
263
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
264
'2 joe@foo.com 20061213 | second\n'
265
'1.1.1 barry@foo.com 20061213 | third\n'
266
'1.1.1.1.1 jerry@foo.com 20061213 | fourth\n'
267
'1.1.1.1.1.1.1 george@foo.com 20061213 | fifth\n'
268
'1.1.1.1.1.1.1 george@foo.com 20061213 | sixth\n',
263
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
264
'2 joe@foo.com 20061213 | second\n'
265
'1.1.1 barry@foo.com 20061213 | third\n'
266
'1.2.1 jerry@foo.com 20061213 | fourth\n'
267
'1.3.1 george@foo.com 20061213 | fifth\n'
268
'1.3.1 george@foo.com 20061213 | sixth\n',
271
271
def test_annotate_uses_branch_context(self):
277
277
tree1 = self.create_deeply_merged_trees()
280
annotate.annotate_file(tree1.branch, 'rev-1_1_1_1_1_1_1', 'a-id',
280
annotate.annotate_file(tree1.branch, 'rev-1_3_1', 'a-id',
281
281
to_file=sio, verbose=False, full=False)
282
self.assertEqualDiff('1 joe@foo | first\n'
283
'1.1.1 barry@f | third\n'
284
'1.1.1.1.1 jerry@f | fourth\n'
285
'1.1.1.1.1.1> george@ | fifth\n'
282
self.assertEqualDiff('1 joe@foo | first\n'
283
'1.1.1 barry@f | third\n'
284
'1.2.1 jerry@f | fourth\n'
285
'1.3.1 george@ | fifth\n'
289
289
def test_annotate_show_ids(self):
294
294
to_file=sio, show_ids=True, full=False)
296
296
# It looks better with real revision ids :)
297
self.assertEqualDiff(' rev-1 | first\n'
299
' rev-1_1_1 | third\n'
300
' rev-1_1_1_1_1 | fourth\n'
301
'rev-1_1_1_1_1_1_1 | fifth\n'
297
self.assertEqualDiff(' rev-1 | first\n'
299
'rev-1_1_1 | third\n'
300
'rev-1_2_1 | fourth\n'
301
'rev-1_3_1 | fifth\n'
306
306
annotate.annotate_file(tree1.branch, 'rev-6', 'a-id',
307
307
to_file=sio, show_ids=True, full=True)
309
self.assertEqualDiff(' rev-1 | first\n'
311
' rev-1_1_1 | third\n'
312
' rev-1_1_1_1_1 | fourth\n'
313
'rev-1_1_1_1_1_1_1 | fifth\n'
314
'rev-1_1_1_1_1_1_1 | sixth\n',
309
self.assertEqualDiff(' rev-1 | first\n'
311
'rev-1_1_1 | third\n'
312
'rev-1_2_1 | fourth\n'
313
'rev-1_3_1 | fifth\n'
314
'rev-1_3_1 | sixth\n',
317
317
def test_annotate_unicode_author(self):