297
298
builder = self.create_merged_trees()
299
300
self.assertBranchAnnotate('1 joe@foo | first\n'
300
'2 joe@foo | second\n'
301
'1.1.1 barry@f | third\n',
302
builder.get_branch(), 'a-id', 'rev-3')
301
'2 joe@foo | second\n'
302
'1.1.1 barry@f | third\n',
303
builder.get_branch(), 'a-id', 'rev-3')
305
def test_annotate_file(self):
306
builder = self.create_merged_trees()
309
self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
310
annotate.annotate_file, builder.get_branch(),
311
'rev-3', 'a-id', to_file=to_file)
313
self.assertAnnotateEqualDiff('1 joe@foo | first\n'
314
'2 joe@foo | second\n'
315
'1.1.1 barry@f | third\n',
304
318
def test_annotate_limits_dotted_revnos(self):
305
319
"""Annotate should limit dotted revnos to a depth of 12"""
306
320
builder = self.create_deeply_merged_trees()
309
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
310
to_file=sio, verbose=False, full=False)
311
self.assertEqualDiff('1 joe@foo | first\n'
312
'2 joe@foo | second\n'
313
'1.1.1 barry@f | third\n'
314
'1.2.1 jerry@f | fourth\n'
315
'1.3.1 george@ | fifth\n'
322
self.assertBranchAnnotate('1 joe@foo | first\n'
323
'2 joe@foo | second\n'
324
'1.1.1 barry@f | third\n'
325
'1.2.1 jerry@f | fourth\n'
326
'1.3.1 george@ | fifth\n'
328
builder.get_branch(), 'a-id', 'rev-6',
329
verbose=False, full=False)
320
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
321
to_file=sio, verbose=False, full=True)
322
self.assertEqualDiff('1 joe@foo | first\n'
323
'2 joe@foo | second\n'
324
'1.1.1 barry@f | third\n'
325
'1.2.1 jerry@f | fourth\n'
326
'1.3.1 george@ | fifth\n'
327
'1.3.1 george@ | sixth\n',
331
self.assertBranchAnnotate('1 joe@foo | first\n'
332
'2 joe@foo | second\n'
333
'1.1.1 barry@f | third\n'
334
'1.2.1 jerry@f | fourth\n'
335
'1.3.1 george@ | fifth\n'
336
'1.3.1 george@ | sixth\n',
337
builder.get_branch(), 'a-id', 'rev-6',
338
verbose=False, full=True)
330
340
# verbose=True shows everything, the full revno, user id, and date
332
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
333
to_file=sio, verbose=True, full=False)
334
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
335
'2 joe@foo.com 20061213 | second\n'
336
'1.1.1 barry@foo.com 20061213 | third\n'
337
'1.2.1 jerry@foo.com 20061213 | fourth\n'
338
'1.3.1 george@foo.com 20061213 | fifth\n'
341
self.assertBranchAnnotate('1 joe@foo.com 20061213 | first\n'
342
'2 joe@foo.com 20061213 | second\n'
343
'1.1.1 barry@foo.com 20061213 | third\n'
344
'1.2.1 jerry@foo.com 20061213 | fourth\n'
345
'1.3.1 george@foo.com 20061213 | fifth\n'
347
builder.get_branch(), 'a-id', 'rev-6',
348
verbose=True, full=False)
343
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
344
to_file=sio, verbose=True, full=True)
345
self.assertEqualDiff('1 joe@foo.com 20061213 | first\n'
346
'2 joe@foo.com 20061213 | second\n'
347
'1.1.1 barry@foo.com 20061213 | third\n'
348
'1.2.1 jerry@foo.com 20061213 | fourth\n'
349
'1.3.1 george@foo.com 20061213 | fifth\n'
350
'1.3.1 george@foo.com 20061213 | sixth\n',
350
self.assertBranchAnnotate('1 joe@foo.com 20061213 | first\n'
351
'2 joe@foo.com 20061213 | second\n'
352
'1.1.1 barry@foo.com 20061213 | third\n'
353
'1.2.1 jerry@foo.com 20061213 | fourth\n'
354
'1.3.1 george@foo.com 20061213 | fifth\n'
355
'1.3.1 george@foo.com 20061213 | sixth\n',
356
builder.get_branch(), 'a-id', 'rev-6',
357
verbose=True, full=True)
353
359
def test_annotate_uses_branch_context(self):
354
360
"""Dotted revnos should use the Branch context.
359
365
builder = self.create_deeply_merged_trees()
362
annotate.annotate_file(builder.get_branch(), 'rev-1_3_1', 'a-id',
363
to_file=sio, verbose=False, full=False)
364
self.assertEqualDiff('1 joe@foo | first\n'
365
'1.1.1 barry@f | third\n'
366
'1.2.1 jerry@f | fourth\n'
367
'1.3.1 george@ | fifth\n'
367
self.assertBranchAnnotate('1 joe@foo | first\n'
368
'1.1.1 barry@f | third\n'
369
'1.2.1 jerry@f | fourth\n'
370
'1.3.1 george@ | fifth\n'
372
builder.get_branch(), 'a-id', 'rev-1_3_1',
373
verbose=False, full=False)
371
375
def test_annotate_show_ids(self):
372
376
builder = self.create_deeply_merged_trees()
375
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
376
to_file=sio, show_ids=True, full=False)
378
378
# It looks better with real revision ids :)
379
self.assertEqualDiff(' rev-1 | first\n'
381
'rev-1_1_1 | third\n'
382
'rev-1_2_1 | fourth\n'
383
'rev-1_3_1 | fifth\n'
388
annotate.annotate_file(builder.get_branch(), 'rev-6', 'a-id',
389
to_file=sio, show_ids=True, full=True)
391
self.assertEqualDiff(' rev-1 | first\n'
393
'rev-1_1_1 | third\n'
394
'rev-1_2_1 | fourth\n'
395
'rev-1_3_1 | fifth\n'
396
'rev-1_3_1 | sixth\n',
379
self.assertBranchAnnotate(' rev-1 | first\n'
381
'rev-1_1_1 | third\n'
382
'rev-1_2_1 | fourth\n'
383
'rev-1_3_1 | fifth\n'
385
builder.get_branch(), 'a-id', 'rev-6',
386
show_ids=True, full=False)
388
self.assertBranchAnnotate(' rev-1 | first\n'
390
'rev-1_1_1 | third\n'
391
'rev-1_2_1 | fourth\n'
392
'rev-1_3_1 | fifth\n'
393
'rev-1_3_1 | sixth\n',
394
builder.get_branch(), 'a-id', 'rev-6',
395
show_ids=True, full=True)
399
397
def test_annotate_unicode_author(self):
400
398
tree1 = self.make_branch_and_tree('tree1')