~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-20 14:38:17 UTC
  • mfrom: (6150.3.12 i18n-more-gettext)
  • Revision ID: pqm@pqm.ubuntu.com-20110920143817-505fvpundix8tqv8
(jr) adding gettext() to more strings
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    urlutils,
33
33
    transport,
34
34
    )
 
35
from bzrlib.i18n import gettext
35
36
""")
36
37
 
37
38
from bzrlib.commands import Command
56
57
            bundle_info = read_bundle(bundle_file)
57
58
        else:
58
59
            if verbose:
59
 
                raise errors.BzrCommandError('--verbose requires a merge'
60
 
                    ' directive')
 
60
                raise errors.BzrCommandError(gettext(
 
61
                            '--verbose requires a merge directive'))
61
62
        reader_method = getattr(bundle_info, 'get_bundle_reader', None)
62
63
        if reader_method is None:
63
 
            raise errors.BzrCommandError('Bundle format not supported')
 
64
            raise errors.BzrCommandError(gettext('Bundle format not supported'))
64
65
 
65
66
        by_kind = {}
66
67
        file_ids = set()
70
71
                (bytes, parents, repo_kind, revision_id, file_id))
71
72
            if file_id is not None:
72
73
                file_ids.add(file_id)
73
 
        self.outf.write('Records\n')
 
74
        self.outf.write(gettext('Records\n'))
74
75
        for kind, records in sorted(by_kind.iteritems()):
75
76
            multiparent = sum(1 for b, m, k, r, f in records if
76
77
                              len(m.get('parents', [])) > 1)
77
 
            self.outf.write('%s: %d (%d multiparent)\n' % \
78
 
                (kind, len(records), multiparent))
79
 
        self.outf.write('unique files: %d\n' % len(file_ids))
 
78
            self.outf.write(gettext('{0}: {1} ({2} multiparent)\n').format(
 
79
                kind, len(records), multiparent))
 
80
        self.outf.write(gettext('unique files: %d\n') % len(file_ids))
80
81
        self.outf.write('\n')
81
82
        nicks = set()
82
83
        committers = set()
85
86
                nicks.add(revision.properties['branch-nick'])
86
87
            committers.add(revision.committer)
87
88
 
88
 
        self.outf.write('Revisions\n')
89
 
        self.outf.write(('nicks: %s\n'
 
89
        self.outf.write(gettext('Revisions\n'))
 
90
        self.outf.write((gettext('nicks: %s\n')
90
91
            % ', '.join(sorted(nicks))).encode(term_encoding, 'replace'))
91
 
        self.outf.write(('committers: \n%s\n' %
 
92
        self.outf.write((gettext('committers: \n%s\n') %
92
93
        '\n'.join(sorted(committers)).encode(term_encoding, 'replace')))
93
94
        if verbose:
94
95
            self.outf.write('\n')
96
97
            line = bundle_file.readline()
97
98
            line = bundle_file.readline()
98
99
            content = bundle_file.read().decode('bz2')
99
 
            self.outf.write("Decoded contents\n")
 
100
            self.outf.write(gettext("Decoded contents\n"))
100
101
            self.outf.write(content)
101
102
            self.outf.write('\n')