~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Patch Queue Manager
  • Date: 2016-04-21 04:10:52 UTC
  • mfrom: (6616.1.1 fix-en-user-guide)
  • Revision ID: pqm@pqm.ubuntu.com-20160421041052-clcye7ns1qcl2n7w
(richard-wilbur) Ensure build of English use guide always uses English text
 even when user's locale specifies a different language. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2013, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
710
710
    _fmt = 'Already a branch: "%(path)s".'
711
711
 
712
712
 
 
713
class InvalidBranchName(PathError):
 
714
 
 
715
    _fmt = "Invalid branch name: %(name)s"
 
716
 
 
717
    def __init__(self, name):
 
718
        BzrError.__init__(self)
 
719
        self.name = name
 
720
 
 
721
 
713
722
class ParentBranchExists(AlreadyBranchError):
714
723
 
715
724
    _fmt = 'Parent branch already exists: "%(path)s".'
1677
1686
        TransportError.__init__(self, msg, orig_error=orig_error)
1678
1687
 
1679
1688
 
1680
 
class CertificateError(TransportError):
1681
 
 
1682
 
    _fmt = "Certificate error: %(error)s"
1683
 
 
1684
 
    def __init__(self, error):
1685
 
        self.error = error
1686
 
 
1687
 
 
1688
1689
class InvalidHttpRange(InvalidHttpResponse):
1689
1690
 
1690
1691
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
2768
2769
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2769
2770
 
2770
2771
 
2771
 
class UnknownMailClient(BzrError):
2772
 
 
2773
 
    _fmt = "Unknown mail client: %(mail_client)s"
2774
 
 
2775
 
    def __init__(self, mail_client):
2776
 
        BzrError.__init__(self, mail_client=mail_client)
2777
 
 
2778
 
 
2779
2772
class MailClientNotFound(BzrError):
2780
2773
 
2781
2774
    _fmt = "Unable to find mail client with the following names:"\
2892
2885
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2893
2886
 
2894
2887
 
 
2888
class StoringUncommittedNotSupported(BzrError):
 
2889
 
 
2890
    _fmt = ('Branch "%(display_url)s" does not support storing uncommitted'
 
2891
            ' changes.')
 
2892
 
 
2893
    def __init__(self, branch):
 
2894
        import bzrlib.urlutils as urlutils
 
2895
        user_url = getattr(branch, "user_url", None)
 
2896
        if user_url is None:
 
2897
            display_url = str(branch)
 
2898
        else:
 
2899
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
 
2900
        BzrError.__init__(self, branch=branch, display_url=display_url)
 
2901
 
 
2902
 
2895
2903
class ShelvedChanges(UncommittedChanges):
2896
2904
 
2897
2905
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
3234
3242
 
3235
3243
class ExpandingUnknownOption(BzrError):
3236
3244
 
3237
 
    _fmt = 'Option %(name)s is not defined while expanding "%(string)s".'
 
3245
    _fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
3238
3246
 
3239
3247
    def __init__(self, name, string):
3240
3248
        self.name = name
3241
3249
        self.string = string
3242
3250
 
3243
3251
 
 
3252
class IllegalOptionName(BzrError):
 
3253
 
 
3254
    _fmt = 'Option "%(name)s" is not allowed.'
 
3255
 
 
3256
    def __init__(self, name):
 
3257
        self.name = name
 
3258
 
 
3259
 
3244
3260
class NoCompatibleInter(BzrError):
3245
3261
 
3246
3262
    _fmt = ('No compatible object available for operations from %(source)r '
3339
3355
 
3340
3356
    def __init__(self, feature):
3341
3357
        self.feature = feature
 
3358
 
 
3359
 
 
3360
class ChangesAlreadyStored(BzrCommandError):
 
3361
 
 
3362
    _fmt = ('Cannot store uncommitted changes because this branch already'
 
3363
            ' stores uncommitted changes.')