~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/send.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-16 13:27:14 UTC
  • mfrom: (6138.3.15 i18n-gettext-errors)
  • Revision ID: pqm@pqm.ubuntu.com-20110916132714-w81xvesg996w68r6
(jr) Add gettext() to user error messages
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            mail_client = config.get_mail_client()
53
53
            if (not getattr(mail_client, 'supports_body', False)
54
54
                and body is not None):
55
 
                raise errors.BzrCommandError(
56
 
                    'Mail client "%s" does not support specifying body' %
 
55
                raise errors.BzrCommandError(gettext(
 
56
                    'Mail client "%s" does not support specifying body') %
57
57
                    mail_client.__class__.__name__)
58
58
        if remember and submit_branch is None:
59
 
            raise errors.BzrCommandError(
60
 
                '--remember requires a branch to be specified.')
 
59
            raise errors.BzrCommandError(gettext(
 
60
                '--remember requires a branch to be specified.'))
61
61
        stored_submit_branch = branch.get_submit_branch()
62
62
        remembered_submit_branch = None
63
63
        if submit_branch is None:
71
71
            submit_branch = branch.get_parent()
72
72
            remembered_submit_branch = "parent"
73
73
        if submit_branch is None:
74
 
            raise errors.BzrCommandError('No submit branch known or'
75
 
                                         ' specified')
 
74
            raise errors.BzrCommandError(gettext('No submit branch known or'
 
75
                                         ' specified'))
76
76
        if remembered_submit_branch is not None:
77
77
            trace.note(gettext('Using saved %s location "%s" to determine what '
78
78
                       'changes to submit.'), remembered_submit_branch,
91
91
                try:
92
92
                    format = format_registry.get(formatname)
93
93
                except KeyError:
94
 
                    raise errors.BzrCommandError("No such send format '%s'." % 
 
94
                    raise errors.BzrCommandError(gettext("No such send format '%s'.") % 
95
95
                                                 formatname)
96
96
 
97
97
        stored_public_branch = branch.get_public_branch()
102
102
              or (remember is None and stored_public_branch is None)):
103
103
            branch.set_public_branch(public_branch)
104
104
        if no_bundle and public_branch is None:
105
 
            raise errors.BzrCommandError('No public branch specified or'
106
 
                                         ' known')
 
105
            raise errors.BzrCommandError(gettext('No public branch specified or'
 
106
                                         ' known'))
107
107
        base_revision_id = None
108
108
        revision_id = None
109
109
        if revision is not None:
110
110
            if len(revision) > 2:
111
 
                raise errors.BzrCommandError('bzr send takes '
112
 
                    'at most two one revision identifiers')
 
111
                raise errors.BzrCommandError(gettext('bzr send takes '
 
112
                    'at most two one revision identifiers'))
113
113
            revision_id = revision[-1].as_revision_id(branch)
114
114
            if len(revision) == 2:
115
115
                base_revision_id = revision[0].as_revision_id(branch)
121
121
                    more_warning='Uncommitted changes will not be sent.')
122
122
            revision_id = branch.last_revision()
123
123
        if revision_id == NULL_REVISION:
124
 
            raise errors.BzrCommandError('No revisions to submit.')
 
124
            raise errors.BzrCommandError(gettext('No revisions to submit.'))
125
125
        if format is None:
126
126
            format = format_registry.get()
127
127
        directive = format(branch, revision_id, submit_branch,
132
132
        else:
133
133
            if directive.multiple_output_files:
134
134
                if output == '-':
135
 
                    raise errors.BzrCommandError('- not supported for '
136
 
                        'merge directives that use more than one output file.')
 
135
                    raise errors.BzrCommandError(gettext('- not supported for '
 
136
                        'merge directives that use more than one output file.'))
137
137
                if not os.path.exists(output):
138
138
                    os.mkdir(output, 0755)
139
139
                for (filename, lines) in directive.to_files():
174
174
        if not no_patch:
175
175
            patch_type = 'bundle'
176
176
        else:
177
 
            raise errors.BzrCommandError('Format 0.9 does not'
178
 
                ' permit bundle with no patch')
 
177
            raise errors.BzrCommandError(gettext('Format 0.9 does not'
 
178
                ' permit bundle with no patch'))
179
179
    else:
180
180
        if not no_patch:
181
181
            patch_type = 'diff'