/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/log.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
from __future__ import absolute_import
51
51
 
52
52
import codecs
53
 
from cStringIO import StringIO
54
 
from itertools import (
55
 
    chain,
56
 
    izip,
57
 
    )
 
53
import itertools
58
54
import re
59
55
import sys
60
56
from warnings import (
61
57
    warn,
62
58
    )
63
59
 
64
 
from breezy.lazy_import import lazy_import
 
60
from .lazy_import import lazy_import
65
61
lazy_import(globals(), """
66
62
 
67
63
from breezy import (
78
74
from breezy.i18n import gettext, ngettext
79
75
""")
80
76
 
81
 
from breezy import (
 
77
from . import (
82
78
    lazy_regex,
83
79
    registry,
84
80
    )
85
 
from breezy.osutils import (
 
81
from .osutils import (
86
82
    format_date,
87
83
    format_date_with_offset_in_original_timezone,
88
84
    get_diff_header_encoding,
89
85
    get_terminal_encoding,
90
86
    terminal_width,
91
87
    )
 
88
from breezy.sixish import (
 
89
    BytesIO,
 
90
    PY3,
 
91
    )
 
92
 
 
93
 
 
94
if PY3:
 
95
    izip = zip
 
96
else:
 
97
    izip = itertools.izip
92
98
 
93
99
 
94
100
def find_touching_revisions(branch, file_id):
484
490
            specific_files = [tree_2.id2path(id) for id in file_ids]
485
491
        else:
486
492
            specific_files = None
487
 
        s = StringIO()
 
493
        s = BytesIO()
488
494
        path_encoding = get_diff_header_encoding()
489
495
        diff.show_diff_trees(tree_1, tree_2, s, specific_files, old_label='',
490
496
            new_label='', path_encoding=path_encoding)
661
667
    # shown naturally, i.e. just like it is for linear logging. We can easily
662
668
    # make forward the exact opposite display, but showing the merge revisions
663
669
    # indented at the end seems slightly nicer in that case.
664
 
    view_revisions = chain(iter(initial_revisions),
 
670
    view_revisions = itertools.chain(iter(initial_revisions),
665
671
        _graph_view_revisions(branch, start_rev_id, end_rev_id,
666
672
                              rebase_initial_depths=(direction == 'reverse'),
667
673
                              exclude_common_ancestry=exclude_common_ancestry))
824
830
    """
825
831
    # Convert view_revisions into (view, None, None) groups to fit with
826
832
    # the standard interface here.
827
 
    if type(view_revisions) == list:
 
833
    if isinstance(view_revisions, list):
828
834
        # A single batch conversion is faster than many incremental ones.
829
835
        # As we have all the data, do a batch conversion.
830
836
        nones = [None] * len(view_revisions)
2104
2110
 
2105
2111
# Use the properties handlers to print out bug information if available
2106
2112
def _bugs_properties_handler(revision):
2107
 
    if revision.properties.has_key('bugs'):
 
2113
    if 'bugs' in revision.properties:
2108
2114
        bug_lines = revision.properties['bugs'].split('\n')
2109
2115
        bug_rows = [line.split(' ', 1) for line in bug_lines]
2110
2116
        fixed_bug_urls = [row[0] for row in bug_rows if