/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/errors.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
        self.base = base
285
285
 
286
286
 
287
 
class NoWhoami(BzrError):
288
 
 
289
 
    _fmt = ('Unable to determine your name.\n'
290
 
            "Please, set your name with the 'whoami' command.\n"
291
 
            'E.g. brz whoami "Your Name <name@example.com>"')
292
 
 
293
 
 
294
287
class BzrCommandError(BzrError):
295
288
    """Error from user command"""
296
289
 
1872
1865
    """
1873
1866
 
1874
1867
 
1875
 
class SharedRepositoriesUnsupported(UnsupportedOperation):
1876
 
    _fmt = "Shared repositories are not supported by %(format)r."
1877
 
 
1878
 
    def __init__(self, format):
1879
 
        BzrError.__init__(self, format=format)
1880
 
 
1881
 
 
1882
1868
class GhostTagsNotSupported(BzrError):
1883
1869
 
1884
1870
    _fmt = "Ghost tags not supported by format %(format)r."
2027
2013
        self.revision_id = revision_id
2028
2014
 
2029
2015
 
 
2016
class IllegalUseOfScopeReplacer(InternalBzrError):
 
2017
 
 
2018
    _fmt = ("ScopeReplacer object %(name)r was used incorrectly:"
 
2019
            " %(msg)s%(extra)s")
 
2020
 
 
2021
    def __init__(self, name, msg, extra=None):
 
2022
        BzrError.__init__(self)
 
2023
        self.name = name
 
2024
        self.msg = msg
 
2025
        if extra:
 
2026
            self.extra = ': ' + str(extra)
 
2027
        else:
 
2028
            self.extra = ''
 
2029
 
 
2030
 
 
2031
class InvalidImportLine(InternalBzrError):
 
2032
 
 
2033
    _fmt = "Not a valid import statement: %(msg)\n%(text)s"
 
2034
 
 
2035
    def __init__(self, text, msg):
 
2036
        BzrError.__init__(self)
 
2037
        self.text = text
 
2038
        self.msg = msg
 
2039
 
 
2040
 
 
2041
class ImportNameCollision(InternalBzrError):
 
2042
 
 
2043
    _fmt = ("Tried to import an object to the same name as"
 
2044
            " an existing object. %(name)s")
 
2045
 
 
2046
    def __init__(self, name):
 
2047
        BzrError.__init__(self)
 
2048
        self.name = name
 
2049
 
 
2050
 
2030
2051
class NotAMergeDirective(BzrError):
2031
2052
    """File starting with %(firstline)r is not a merge directive"""
2032
2053
 
2117
2138
class TagsNotSupported(BzrError):
2118
2139
 
2119
2140
    _fmt = ("Tags not supported by %(branch)s;"
2120
 
            " you may be able to use 'brz upgrade %(branch_url)s'.")
 
2141
            " you may be able to use brz upgrade.")
2121
2142
 
2122
2143
    def __init__(self, branch):
2123
2144
        self.branch = branch
2124
 
        self.branch_url = branch.user_url
2125
2145
 
2126
2146
 
2127
2147
class TagAlreadyExists(BzrError):
2283
2303
            ' (See brz shelve --list).%(more)s')
2284
2304
 
2285
2305
 
 
2306
class UnableCreateSymlink(BzrError):
 
2307
 
 
2308
    _fmt = 'Unable to create symlink %(path_str)son this platform'
 
2309
 
 
2310
    def __init__(self, path=None):
 
2311
        path_str = ''
 
2312
        if path:
 
2313
            try:
 
2314
                path_str = repr(str(path))
 
2315
            except UnicodeEncodeError:
 
2316
                path_str = repr(path)
 
2317
            path_str += ' '
 
2318
        self.path_str = path_str
 
2319
 
 
2320
 
2286
2321
class UnableEncodePath(BzrError):
2287
2322
 
2288
2323
    _fmt = ('Unable to encode %(kind)s path %(path)r in '