/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/annotate.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 11:19:09 UTC
  • mfrom: (7143.11.6 unused-imports)
  • Revision ID: breezy.the.bot@gmail.com-20181116111909-ekbys9z1ujp66gh2
Remove some unused imports.

Merged from https://code.launchpad.net/~jelmer/brz/unused-imports/+merge/358595

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    )
39
39
""")
40
40
from . import (
41
 
    errors,
42
41
    osutils,
43
42
    )
44
43
from .config import (
54
53
 
55
54
 
56
55
def annotate_file_tree(tree, path, to_file, verbose=False, full=False,
57
 
    show_ids=False, branch=None, file_id=None):
 
56
                       show_ids=False, branch=None, file_id=None):
58
57
    """Annotate file_id in a tree.
59
58
 
60
59
    The tree should already be read_locked() when annotate_file_tree is called.
109
108
    :param full: XXXX Not sure what this does.
110
109
    """
111
110
    if len(annotation) == 0:
112
 
        max_origin_len = max_revno_len = max_revid_len = 0
 
111
        max_origin_len = max_revno_len = 0
113
112
    else:
114
113
        max_origin_len = max(len(x[1]) for x in annotation)
115
114
        max_revno_len = max(len(x[0]) for x in annotation)
116
 
        max_revid_len = max(len(x[3]) for x in annotation)
117
115
    if not verbose:
118
116
        max_revno_len = min(max_revno_len, 12)
119
117
    max_revno_len = max(max_revno_len, 3)
126
124
                                       max_origin_len, author, date_str)
127
125
        else:
128
126
            if len(revno_str) > max_revno_len:
129
 
                revno_str = revno_str[:max_revno_len-1] + '>'
 
127
                revno_str = revno_str[:max_revno_len - 1] + '>'
130
128
            anno = "%-*s %-7s " % (max_revno_len, revno_str, author[:7])
131
129
        if anno.lstrip() == "" and full:
132
130
            anno = prevanno
290
288
    for i, j, n in matching_blocks:
291
289
        for line in new_lines[new_cur:j]:
292
290
            lines.append((new_revision_id, line))
293
 
        lines.extend(parent_lines[i:i+n])
 
291
        lines.extend(parent_lines[i:i + n])
294
292
        new_cur = j + n
295
293
    return lines
296
294
 
302
300
 
303
301
_break_annotation_tie = None
304
302
 
 
303
 
305
304
def _old_break_annotation_tie(annotated_lines):
306
305
    """Chose an attribution between several possible ones.
307
306
 
412
411
    # be the bulk of the lines, and they will need no further processing.
413
412
    lines = []
414
413
    lines_extend = lines.extend
415
 
    last_right_idx = 0 # The line just after the last match from the right side
 
414
    last_right_idx = 0  # The line just after the last match from the right side
416
415
    last_left_idx = 0
417
416
    matching_left_and_right = _get_matching_blocks(right_parent_lines,
418
417
                                                   annotated_lines)
443
442
    from breezy._annotator_pyx import Annotator
444
443
except ImportError as e:
445
444
    osutils.failed_to_load_extension(e)
446
 
    from breezy._annotator_py import Annotator
 
445
    from breezy._annotator_py import Annotator  # noqa: F401