~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""File annotate based on weave storage"""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
# TODO: Choice of more or less verbose formats:
20
22
#
21
23
# interposed: show more details between blocks of modified lines
45
47
    CURRENT_REVISION,
46
48
    Revision,
47
49
    )
48
 
from bzrlib.symbol_versioning import (
49
 
    deprecated_function,
50
 
    deprecated_in,
51
 
    )
52
 
 
53
 
 
54
 
@deprecated_function(deprecated_in((2, 4, 0)))
55
 
def annotate_file(branch, rev_id, file_id, verbose=False, full=False,
56
 
                  to_file=None, show_ids=False):
57
 
    """Annotate file_id at revision rev_id in branch.
58
 
 
59
 
    The branch should already be read_locked() when annotate_file is called.
60
 
 
61
 
    :param branch: The branch to look for revision numbers and history from.
62
 
    :param rev_id: The revision id to annotate.
63
 
    :param file_id: The file_id to annotate.
64
 
    :param verbose: Show all details rather than truncating to ensure
65
 
        reasonable text width.
66
 
    :param full: XXXX Not sure what this does.
67
 
    :param to_file: The file to output the annotation to; if None stdout is
68
 
        used.
69
 
    :param show_ids: Show revision ids in the annotation output.
70
 
    """
71
 
    tree = branch.repository.revision_tree(rev_id)
72
 
    annotate_file_tree(tree, file_id, to_file, verbose=verbose,
73
 
        full=full, show_ids=show_ids, branch=branch)
74
50
 
75
51
 
76
52
def annotate_file_tree(tree, file_id, to_file, verbose=False, full=False,
105
81
        current_rev = Revision(CURRENT_REVISION)
106
82
        current_rev.parent_ids = tree.get_parent_ids()
107
83
        try:
108
 
            current_rev.committer = branch.get_config().username()
 
84
            current_rev.committer = branch.get_config_stack().get('email')
109
85
        except errors.NoWhoami:
110
86
            current_rev.committer = 'local user'
111
87
        current_rev.message = "?"