/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: Jonathan Lange
  • Date: 2009-12-09 09:20:42 UTC
  • mfrom: (4881 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4907.
  • Revision ID: jml@canonical.com-20091209092042-s2zgqcf8f39yzxpj
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
793
793
 
794
794
 
795
795
class IncompatibleRepositories(BzrError):
 
796
    """Report an error that two repositories are not compatible.
 
797
 
 
798
    Note that the source and target repositories are permitted to be strings:
 
799
    this exception is thrown from the smart server and may refer to a
 
800
    repository the client hasn't opened.
 
801
    """
796
802
 
797
803
    _fmt = "%(target)s\n" \
798
804
            "is not compatible with\n" \
2006
2012
 
2007
2013
class BadConversionTarget(BzrError):
2008
2014
 
2009
 
    _fmt = "Cannot convert to format %(format)s.  %(problem)s"
 
2015
    _fmt = "Cannot convert from format %(from_format)s to format %(format)s." \
 
2016
            "    %(problem)s"
2010
2017
 
2011
 
    def __init__(self, problem, format):
 
2018
    def __init__(self, problem, format, from_format=None):
2012
2019
        BzrError.__init__(self)
2013
2020
        self.problem = problem
2014
2021
        self.format = format
 
2022
        self.from_format = from_format or '(unspecified)'
2015
2023
 
2016
2024
 
2017
2025
class NoDiffFound(BzrError):
2162
2170
        self.reason = reason
2163
2171
 
2164
2172
 
 
2173
class InconsistentDeltaDelta(InconsistentDelta):
 
2174
    """Used when we get a delta that is not valid."""
 
2175
 
 
2176
    _fmt = ("An inconsistent delta was supplied: %(delta)r"
 
2177
            "\nreason: %(reason)s")
 
2178
 
 
2179
    def __init__(self, delta, reason):
 
2180
        BzrError.__init__(self)
 
2181
        self.delta = delta
 
2182
        self.reason = reason
 
2183
 
 
2184
 
2165
2185
class UpgradeRequired(BzrError):
2166
2186
 
2167
2187
    _fmt = "To use this feature you must upgrade your branch at %(path)s."
2906
2926
    _fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
2907
2927
 
2908
2928
    def __init__(self, host, port, orig_error):
 
2929
        # nb: in python2.4 socket.error doesn't have a useful repr
2909
2930
        BzrError.__init__(self, host=host, port=port,
2910
 
            orig_error=orig_error[1])
 
2931
            orig_error=repr(orig_error.args))
2911
2932
 
2912
2933
 
2913
2934
class UnknownRules(BzrError):