/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 bzrlib/bundle/commands.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from __future__ import absolute_import
25
25
 
26
 
from ..lazy_import import lazy_import
 
26
from cStringIO import StringIO
 
27
 
 
28
from bzrlib.lazy_import import lazy_import
27
29
lazy_import(globals(), """
28
 
from breezy import (
 
30
from bzrlib import (
29
31
    branch,
30
32
    errors,
31
33
    merge_directive,
33
35
    urlutils,
34
36
    transport,
35
37
    )
36
 
from breezy.i18n import gettext
 
38
from bzrlib.i18n import gettext
37
39
""")
38
40
 
39
 
from ..commands import Command
40
 
from ..sixish import (
41
 
    BytesIO,
42
 
    viewitems,
43
 
    )
 
41
from bzrlib.commands import Command
44
42
 
45
43
 
46
44
class cmd_bundle_info(Command):
52
50
    encoding_type = 'exact'
53
51
 
54
52
    def run(self, location, verbose=False):
55
 
        from breezy.bundle.serializer import read_bundle
56
 
        from breezy.bundle import read_mergeable_from_url
57
 
        from breezy import osutils
 
53
        from bzrlib.bundle.serializer import read_bundle
 
54
        from bzrlib.bundle import read_mergeable_from_url
 
55
        from bzrlib import osutils
58
56
        term_encoding = osutils.get_terminal_encoding()
59
57
        bundle_info = read_mergeable_from_url(location)
60
58
        if isinstance(bundle_info, merge_directive.BaseMergeDirective):
61
 
            bundle_file = BytesIO(bundle_info.get_raw_bundle())
 
59
            bundle_file = StringIO(bundle_info.get_raw_bundle())
62
60
            bundle_info = read_bundle(bundle_file)
63
61
        else:
64
62
            if verbose:
77
75
            if file_id is not None:
78
76
                file_ids.add(file_id)
79
77
        self.outf.write(gettext('Records\n'))
80
 
        for kind, records in sorted(viewitems(by_kind)):
 
78
        for kind, records in sorted(by_kind.iteritems()):
81
79
            multiparent = sum(1 for b, m, k, r, f in records if
82
80
                              len(m.get('parents', [])) > 1)
83
81
            self.outf.write(gettext('{0}: {1} ({2} multiparent)\n').format(