/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

Merge trunk

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 "
669
684
 
670
685
class UnknownFormatError(BzrError):
671
686
    
672
 
    _fmt = "Unknown branch format: %(format)r"
 
687
    _fmt = "Unknown %(kind)s format: %(format)r"
 
688
 
 
689
    def __init__(self, format, kind='branch'):
 
690
        self.kind = kind
 
691
        self.format = format
673
692
 
674
693
 
675
694
class IncompatibleFormat(BzrError):
1971
1990
    _fmt = "Format error in conflict listings"
1972
1991
 
1973
1992
 
 
1993
class CorruptDirstate(BzrError):
 
1994
 
 
1995
    _fmt = ("Inconsistency in dirstate file %(dirstate_path)s.\n"
 
1996
            "Error: %(description)s")
 
1997
 
 
1998
    def __init__(self, dirstate_path, description):
 
1999
        BzrError.__init__(self)
 
2000
        self.dirstate_path = dirstate_path
 
2001
        self.description = description
 
2002
 
 
2003
 
1974
2004
class CorruptRepository(BzrError):
1975
2005
 
1976
2006
    _fmt = ("An error has been detected in the repository %(repo_path)s.\n"
1981
2011
        self.repo_path = repo.bzrdir.root_transport.base
1982
2012
 
1983
2013
 
 
2014
class InconsistentDelta(BzrError):
 
2015
    """Used when we get a delta that is not valid."""
 
2016
 
 
2017
    _fmt = ("An inconsistent delta was supplied involving %(path)r,"
 
2018
            " %(file_id)r\nreason: %(reason)s")
 
2019
 
 
2020
    def __init__(self, path, file_id, reason):
 
2021
        BzrError.__init__(self)
 
2022
        self.path = path
 
2023
        self.file_id = file_id
 
2024
        self.reason = reason
 
2025
 
 
2026
 
1984
2027
class UpgradeRequired(BzrError):
1985
2028
 
1986
2029
    _fmt = "To use this feature you must upgrade your branch at %(path)s."
2510
2553
        self.name = name
2511
2554
 
2512
2555
 
 
2556
class NoTemplate(BzrError):
 
2557
 
 
2558
    _fmt = 'No template specified.'
 
2559
 
 
2560
 
2513
2561
class UnableCreateSymlink(BzrError):
2514
2562
 
2515
2563
    _fmt = 'Unable to create symlink %(path_str)son this platform'
2532
2580
 
2533
2581
    def __init__(self, timezone):
2534
2582
        self.timezone = timezone
 
2583
 
 
2584
 
 
2585
class UnableEncodePath(BzrError):
 
2586
 
 
2587
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
 
2588
            'user encoding %(user_encoding)s')
 
2589
 
 
2590
    def __init__(self, path, kind):
 
2591
        self.path = path
 
2592
        self.kind = kind
 
2593
        self.user_encoding = osutils.get_user_encoding()