~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Patch Queue Manager
  • Date: 2016-01-31 13:36:59 UTC
  • mfrom: (6613.1.5 1538480-match-hostname)
  • Revision ID: pqm@pqm.ubuntu.com-20160131133659-ouy92ee2wlv9xz8m
(vila) Use ssl.match_hostname instead of our own. (Vincent Ladeuil)

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"
2884
2885
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2885
2886
 
2886
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
 
2887
2903
class ShelvedChanges(UncommittedChanges):
2888
2904
 
2889
2905
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
3226
3242
 
3227
3243
class ExpandingUnknownOption(BzrError):
3228
3244
 
3229
 
    _fmt = 'Option %(name)s is not defined while expanding "%(string)s".'
 
3245
    _fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
3230
3246
 
3231
3247
    def __init__(self, name, string):
3232
3248
        self.name = name
3233
3249
        self.string = string
3234
3250
 
3235
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
 
3236
3260
class NoCompatibleInter(BzrError):
3237
3261
 
3238
3262
    _fmt = ('No compatible object available for operations from %(source)r '
3331
3355
 
3332
3356
    def __init__(self, feature):
3333
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.')