~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2013, 2016 Canonical Ltd
 
1
# Copyright (C) 2005-2011 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
 
 
722
713
class ParentBranchExists(AlreadyBranchError):
723
714
 
724
715
    _fmt = 'Parent branch already exists: "%(path)s".'
1686
1677
        TransportError.__init__(self, msg, orig_error=orig_error)
1687
1678
 
1688
1679
 
 
1680
class CertificateError(TransportError):
 
1681
 
 
1682
    _fmt = "Certificate error: %(error)s"
 
1683
 
 
1684
    def __init__(self, error):
 
1685
        self.error = error
 
1686
 
 
1687
 
1689
1688
class InvalidHttpRange(InvalidHttpResponse):
1690
1689
 
1691
1690
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"
2769
2768
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2770
2769
 
2771
2770
 
 
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
 
2772
2779
class MailClientNotFound(BzrError):
2773
2780
 
2774
2781
    _fmt = "Unable to find mail client with the following names:"\
2885
2892
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2886
2893
 
2887
2894
 
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
 
 
2903
2895
class ShelvedChanges(UncommittedChanges):
2904
2896
 
2905
2897
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
3242
3234
 
3243
3235
class ExpandingUnknownOption(BzrError):
3244
3236
 
3245
 
    _fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
 
3237
    _fmt = 'Option %(name)s is not defined while expanding "%(string)s".'
3246
3238
 
3247
3239
    def __init__(self, name, string):
3248
3240
        self.name = name
3249
3241
        self.string = string
3250
3242
 
3251
3243
 
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
 
 
3260
3244
class NoCompatibleInter(BzrError):
3261
3245
 
3262
3246
    _fmt = ('No compatible object available for operations from %(source)r '
3355
3339
 
3356
3340
    def __init__(self, feature):
3357
3341
        self.feature = feature
3358
 
 
3359
 
 
3360
 
class ChangesAlreadyStored(BzrCommandError):
3361
 
 
3362
 
    _fmt = ('Cannot store uncommitted changes because this branch already'
3363
 
            ' stores uncommitted changes.')