~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-02 17:16:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5369.
  • Revision ID: john@arbash-meinel.com-20100802171612-rdh5ods70w2bl3j7
We also have to re-implement it for _simple_set_pyx.pyx

Show diffs side-by-side

added added

removed removed

Lines of Context:
680
680
 
681
681
    _fmt = 'Path "%(path)s" is not a child of path "%(base)s"%(extra)s'
682
682
 
683
 
    internal_error = True
 
683
    internal_error = False
684
684
 
685
685
    def __init__(self, path, base, extra=None):
686
686
        BzrError.__init__(self)
782
782
 
783
783
    _fmt = 'File "%(path)s" is not in branch %(branch_base)s.'
784
784
 
 
785
    # use PathNotChild instead
 
786
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 3, 0)))
785
787
    def __init__(self, branch, path):
786
788
        BzrError.__init__(self)
787
789
        self.branch = branch
1041
1043
class LockContention(LockError):
1042
1044
 
1043
1045
    _fmt = 'Could not acquire lock "%(lock)s": %(msg)s'
1044
 
    # TODO: show full url for lock, combining the transport and relative
1045
 
    # bits?
1046
1046
 
1047
1047
    internal_error = False
1048
1048
 
1180
1180
class InvalidRevisionSpec(BzrError):
1181
1181
 
1182
1182
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
1183
 
            " %(branch)s%(extra)s")
 
1183
            " %(branch_url)s%(extra)s")
1184
1184
 
1185
1185
    def __init__(self, spec, branch, extra=None):
1186
1186
        BzrError.__init__(self, branch=branch, spec=spec)
 
1187
        self.branch_url = getattr(branch, 'user_url', str(branch))
1187
1188
        if extra:
1188
1189
            self.extra = '\n' + str(extra)
1189
1190
        else:
1925
1926
    _fmt = "Moving the root directory is not supported at this time"
1926
1927
 
1927
1928
 
 
1929
class TransformRenameFailed(BzrError):
 
1930
 
 
1931
    _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
 
1932
 
 
1933
    def __init__(self, from_path, to_path, why, errno):
 
1934
        self.from_path = from_path
 
1935
        self.to_path = to_path
 
1936
        self.why = why
 
1937
        self.errno = errno
 
1938
 
 
1939
 
1928
1940
class BzrMoveFailedError(BzrError):
1929
1941
 
1930
1942
    _fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
2839
2851
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2840
2852
 
2841
2853
 
 
2854
class ShelvedChanges(UncommittedChanges):
 
2855
 
 
2856
    _fmt = ('Working tree "%(display_url)s" has shelved changes'
 
2857
            ' (See bzr shelve --list).%(more)s')
 
2858
 
 
2859
 
2842
2860
class MissingTemplateVariable(BzrError):
2843
2861
 
2844
2862
    _fmt = 'Variable {%(name)s} is not available.'
3134
3152
    def __init__(self, bzrdir):
3135
3153
        self.bzrdir = bzrdir
3136
3154
 
 
3155
class NoWhoami(BzrError):
 
3156
 
 
3157
    _fmt = ('Unable to determine your name.\n'
 
3158
        "Please, set your name with the 'whoami' command.\n"
 
3159
        'E.g. bzr whoami "Your Name <name@example.com>"')
 
3160
 
 
3161
class InvalidPattern(BzrError):
 
3162
 
 
3163
    _fmt = ('Invalid pattern(s) found. %(msg)s')
 
3164
 
 
3165
    def __init__(self, msg):
 
3166
        self.msg = msg
 
3167