/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: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

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
 
287
294
class BzrCommandError(BzrError):
288
295
    """Error from user command"""
289
296
 
1865
1872
    """
1866
1873
 
1867
1874
 
 
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
 
1868
1882
class GhostTagsNotSupported(BzrError):
1869
1883
 
1870
1884
    _fmt = "Ghost tags not supported by format %(format)r."
2013
2027
        self.revision_id = revision_id
2014
2028
 
2015
2029
 
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
 
 
2051
2030
class NotAMergeDirective(BzrError):
2052
2031
    """File starting with %(firstline)r is not a merge directive"""
2053
2032
 
2138
2117
class TagsNotSupported(BzrError):
2139
2118
 
2140
2119
    _fmt = ("Tags not supported by %(branch)s;"
2141
 
            " you may be able to use brz upgrade.")
 
2120
            " you may be able to use 'brz upgrade %(branch_url)s'.")
2142
2121
 
2143
2122
    def __init__(self, branch):
2144
2123
        self.branch = branch
 
2124
        self.branch_url = branch.user_url
2145
2125
 
2146
2126
 
2147
2127
class TagAlreadyExists(BzrError):
2303
2283
            ' (See brz shelve --list).%(more)s')
2304
2284
 
2305
2285
 
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
 
 
2321
2286
class UnableEncodePath(BzrError):
2322
2287
 
2323
2288
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
2452
2417
 
2453
2418
    _fmt = ('Cannot store uncommitted changes because this branch already'
2454
2419
            ' stores uncommitted changes.')
 
2420
 
 
2421
 
 
2422
class RevnoOutOfBounds(InternalBzrError):
 
2423
 
 
2424
    _fmt = ("The requested revision number %(revno)d is outside of the "
 
2425
            "expected boundaries (%(minimum)d <= %(maximum)d).")
 
2426
 
 
2427
    def __init__(self, revno, bounds):
 
2428
        InternalBzrError.__init__(
 
2429
            self, revno=revno, minimum=bounds[0], maximum=bounds[1])