~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Vincent Ladeuil
  • Date: 2016-02-07 18:23:13 UTC
  • mto: (6615.3.1 2.7)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20160207182313-jwz7z3vj4mpyjn7y
Ensure http://pad.lv/1323805 won't come back.

Since the 2.6.0 release pypi policy changed and release tarballs can't be
hosted on launchpad anymore, they have to be uploaded to
http://pypi.python.org/pypi


This fixes setup.py sdist to generate the right tarball with nearly the same
content as the one produced for 2.7.0.

Such a tarball have been uploaded to pypi properly signed and tested for
installation in venv.

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
700
700
       self.path = urlutils.unescape_for_display(branch.base, 'ascii')
701
701
 
702
702
 
 
703
class AlreadyControlDirError(PathError):
 
704
 
 
705
    _fmt = 'A control directory already exists: "%(path)s".'
 
706
 
 
707
 
703
708
class AlreadyBranchError(PathError):
704
709
 
705
710
    _fmt = 'Already a branch: "%(path)s".'
706
711
 
707
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
class ParentBranchExists(AlreadyBranchError):
 
723
 
 
724
    _fmt = 'Parent branch already exists: "%(path)s".'
 
725
 
 
726
 
708
727
class BranchExistsWithoutWorkingTree(PathError):
709
728
 
710
729
    _fmt = 'Directory contains a branch, but no working tree \
763
782
        self.bzrdir = bzrdir_format
764
783
 
765
784
 
 
785
class ParseFormatError(BzrError):
 
786
 
 
787
    _fmt = "Parse error on line %(lineno)d of %(format)s format: %(line)s"
 
788
 
 
789
    def __init__(self, format, lineno, line, text):
 
790
        BzrError.__init__(self)
 
791
        self.format = format
 
792
        self.lineno = lineno
 
793
        self.line = line
 
794
        self.text = text
 
795
 
 
796
 
766
797
class IncompatibleRepositories(BzrError):
767
798
    """Report an error that two repositories are not compatible.
768
799
 
1731
1762
 
1732
1763
class ConfigOptionValueError(BzrError):
1733
1764
 
1734
 
    _fmt = """Bad value "%(value)s" for option "%(name)s"."""
 
1765
    _fmt = ('Bad value "%(value)s" for option "%(name)s".\n'
 
1766
            'See ``bzr help %(name)s``')
1735
1767
 
1736
1768
    def __init__(self, name, value):
1737
1769
        BzrError.__init__(self, name=name, value=value)
2737
2769
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2738
2770
 
2739
2771
 
2740
 
class UnknownMailClient(BzrError):
2741
 
 
2742
 
    _fmt = "Unknown mail client: %(mail_client)s"
2743
 
 
2744
 
    def __init__(self, mail_client):
2745
 
        BzrError.__init__(self, mail_client=mail_client)
2746
 
 
2747
 
 
2748
2772
class MailClientNotFound(BzrError):
2749
2773
 
2750
2774
    _fmt = "Unable to find mail client with the following names:"\
2861
2885
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2862
2886
 
2863
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
 
2864
2903
class ShelvedChanges(UncommittedChanges):
2865
2904
 
2866
2905
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
3203
3242
 
3204
3243
class ExpandingUnknownOption(BzrError):
3205
3244
 
3206
 
    _fmt = 'Option %(name)s is not defined while expanding "%(string)s".'
 
3245
    _fmt = 'Option "%(name)s" is not defined while expanding "%(string)s".'
3207
3246
 
3208
3247
    def __init__(self, name, string):
3209
3248
        self.name = name
3210
3249
        self.string = string
3211
3250
 
3212
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
 
3213
3260
class NoCompatibleInter(BzrError):
3214
3261
 
3215
3262
    _fmt = ('No compatible object available for operations from %(source)r '
3242
3289
        self.format = format
3243
3290
 
3244
3291
 
 
3292
class MissingFeature(BzrError):
 
3293
 
 
3294
    _fmt = ("Missing feature %(feature)s not provided by this "
 
3295
            "version of Bazaar or any plugin.")
 
3296
 
 
3297
    def __init__(self, feature):
 
3298
        self.feature = feature
 
3299
 
 
3300
 
3245
3301
class PatchSyntax(BzrError):
3246
3302
    """Base class for patch syntax errors."""
3247
3303
 
3291
3347
        self.line_no = line_no
3292
3348
        self.orig_line = orig_line.rstrip('\n')
3293
3349
        self.patch_line = patch_line.rstrip('\n')
 
3350
 
 
3351
 
 
3352
class FeatureAlreadyRegistered(BzrError):
 
3353
 
 
3354
    _fmt = 'The feature %(feature)s has already been registered.'
 
3355
 
 
3356
    def __init__(self, feature):
 
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.')