~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Patch Queue Manager
  • Date: 2012-09-05 20:52:26 UTC
  • mfrom: (6549.3.1 dev_2.5_integration)
  • Revision ID: pqm@pqm.ubuntu.com-20120905205226-8s3bzolvduug3ifj
(gz) Merge 2.5 (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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".'
2768
2777
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2769
2778
 
2770
2779
 
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
2780
class MailClientNotFound(BzrError):
2780
2781
 
2781
2782
    _fmt = "Unable to find mail client with the following names:"\
2892
2893
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2893
2894
 
2894
2895
 
 
2896
class StoringUncommittedNotSupported(BzrError):
 
2897
 
 
2898
    _fmt = ('Branch "%(display_url)s" does not support storing uncommitted'
 
2899
            ' changes.')
 
2900
 
 
2901
    def __init__(self, branch):
 
2902
        import bzrlib.urlutils as urlutils
 
2903
        user_url = getattr(branch, "user_url", None)
 
2904
        if user_url is None:
 
2905
            display_url = str(branch)
 
2906
        else:
 
2907
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
 
2908
        BzrError.__init__(self, branch=branch, display_url=display_url)
 
2909
 
 
2910
 
2895
2911
class ShelvedChanges(UncommittedChanges):
2896
2912
 
2897
2913
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
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.')