~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_annotate.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-03 13:53:46 UTC
  • mto: This revision was merged to the branch mainline in revision 5826.
  • Revision ID: jelmer@samba.org-20110503135346-l2f6xnenzn3320gv
Kill annotate_file_revision_tree() in favor annotate_file_tree().

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
            verbose=False, full=False, show_ids=False):
273
273
        tree = branch.repository.revision_tree(revision_id)
274
274
        to_file = StringIO()
275
 
        annotate.annotate_file_revision_tree(tree, file_id, to_file,
 
275
        annotate.annotate_file_tree(tree, file_id, to_file,
276
276
            verbose=verbose, full=full, show_ids=show_ids, branch=branch)
277
277
        self.assertAnnotateEqualDiff(to_file.getvalue(), expected)
278
278
 
417
417
 
418
418
        # this passes if no exception is raised
419
419
        to_file = StringIO()
420
 
        annotate.annotate_file_revision_tree(revtree_1, 'a-id',
 
420
        annotate.annotate_file_tree(revtree_1, 'a-id',
421
421
            to_file=to_file, branch=tree1.branch)
422
422
 
423
423
        sio = StringIO()
424
424
        to_file = codecs.getwriter('ascii')(sio)
425
425
        to_file.encoding = 'ascii' # codecs does not set it
426
 
        annotate.annotate_file_revision_tree(revtree_2, 'b-id',
 
426
        annotate.annotate_file_tree(revtree_2, 'b-id',
427
427
            to_file=to_file, branch=tree1.branch)
428
428
        self.assertEqualDiff('2   p?rez   | bye\n', sio.getvalue())
429
429
 
430
430
        # test now with to_file.encoding = None
431
431
        to_file = tests.StringIOWrapper()
432
432
        to_file.encoding = None
433
 
        annotate.annotate_file_revision_tree(revtree_2, 'b-id',
 
433
        annotate.annotate_file_tree(revtree_2, 'b-id',
434
434
            to_file=to_file, branch=tree1.branch)
435
435
        self.assertContainsRe('2   p.rez   | bye\n', to_file.getvalue())
436
436
 
437
437
        # and when it does not exist
438
438
        to_file = StringIO()
439
 
        annotate.annotate_file_revision_tree(revtree_2, 'b-id',
 
439
        annotate.annotate_file_tree(revtree_2, 'b-id',
440
440
            to_file=to_file, branch=tree1.branch)
441
441
        self.assertContainsRe('2   p.rez   | bye\n', to_file.getvalue())
442
442