/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 bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-27 06:10:18 UTC
  • mfrom: (3309 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20080327061018-dxztpxyv6yoeg3am
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 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
267
267
        "record_entry_contents.")
268
268
 
269
269
 
 
270
class NoPublicBranch(BzrError):
 
271
 
 
272
    _fmt = 'There is no public branch set for "%(branch_url)s".'
 
273
 
 
274
    def __init__(self, branch):
 
275
        import bzrlib.urlutils as urlutils
 
276
        public_location = urlutils.unescape_for_display(branch.base, 'ascii')
 
277
        BzrError.__init__(self, branch_url=public_location)
 
278
 
 
279
 
270
280
class NoHelpTopic(BzrError):
271
281
 
272
282
    _fmt = ("No help could be found for '%(topic)s'. "
499
509
    _fmt = 'Directory not empty: "%(path)s"%(extra)s'
500
510
 
501
511
 
 
512
class HardLinkNotSupported(PathError):
 
513
 
 
514
    _fmt = 'Hard-linking "%(path)s" is not supported'
 
515
 
 
516
 
502
517
class ReadingCompleted(InternalBzrError):
503
518
    
504
519
    _fmt = ("The MediumRequest '%(request)s' has already had finish_reading "
671
686
 
672
687
class UnknownFormatError(BzrError):
673
688
    
674
 
    _fmt = "Unknown branch format: %(format)r"
 
689
    _fmt = "Unknown %(kind)s format: %(format)r"
 
690
 
 
691
    def __init__(self, format, kind='branch'):
 
692
        self.kind = kind
 
693
        self.format = format
675
694
 
676
695
 
677
696
class IncompatibleFormat(BzrError):
1973
1992
    _fmt = "Format error in conflict listings"
1974
1993
 
1975
1994
 
 
1995
class CorruptDirstate(BzrError):
 
1996
 
 
1997
    _fmt = ("Inconsistency in dirstate file %(dirstate_path)s.\n"
 
1998
            "Error: %(description)s")
 
1999
 
 
2000
    def __init__(self, dirstate_path, description):
 
2001
        BzrError.__init__(self)
 
2002
        self.dirstate_path = dirstate_path
 
2003
        self.description = description
 
2004
 
 
2005
 
1976
2006
class CorruptRepository(BzrError):
1977
2007
 
1978
2008
    _fmt = ("An error has been detected in the repository %(repo_path)s.\n"
1983
2013
        self.repo_path = repo.bzrdir.root_transport.base
1984
2014
 
1985
2015
 
 
2016
class InconsistentDelta(BzrError):
 
2017
    """Used when we get a delta that is not valid."""
 
2018
 
 
2019
    _fmt = ("An inconsistent delta was supplied involving %(path)r,"
 
2020
            " %(file_id)r\nreason: %(reason)s")
 
2021
 
 
2022
    def __init__(self, path, file_id, reason):
 
2023
        BzrError.__init__(self)
 
2024
        self.path = path
 
2025
        self.file_id = file_id
 
2026
        self.reason = reason
 
2027
 
 
2028
 
1986
2029
class UpgradeRequired(BzrError):
1987
2030
 
1988
2031
    _fmt = "To use this feature you must upgrade your branch at %(path)s."
2141
2184
 
2142
2185
    _fmt = "No smart server available at %(url)s"
2143
2186
 
 
2187
    @symbol_versioning.deprecated_method(symbol_versioning.one_four)
2144
2188
    def __init__(self, url):
2145
2189
        self.url = url
2146
2190
 
2512
2556
        self.name = name
2513
2557
 
2514
2558
 
 
2559
class NoTemplate(BzrError):
 
2560
 
 
2561
    _fmt = 'No template specified.'
 
2562
 
 
2563
 
2515
2564
class UnableCreateSymlink(BzrError):
2516
2565
 
2517
2566
    _fmt = 'Unable to create symlink %(path_str)son this platform'
2534
2583
 
2535
2584
    def __init__(self, timezone):
2536
2585
        self.timezone = timezone
 
2586
 
 
2587
 
 
2588
class NotATerminal(BzrError):
 
2589
 
 
2590
    _fmt = 'Unable to ask for a password without real terminal.'
 
2591
 
 
2592
 
 
2593
class UnableEncodePath(BzrError):
 
2594
 
 
2595
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
 
2596
            'user encoding %(user_encoding)s')
 
2597
 
 
2598
    def __init__(self, path, kind):
 
2599
        self.path = path
 
2600
        self.kind = kind
 
2601
        self.user_encoding = osutils.get_user_encoding()