##// END OF EJS Templates
revlog: kill from-style imports...
revlog: kill from-style imports They're slow.

File last commit:

r7633:08cabecf default
r7634:14a4337a default
Show More
error.py
26 lines | 755 B | text/x-python | PythonLexer
"""
error.py - Mercurial exceptions
This allows us to catch exceptions at higher levels without forcing imports
Copyright 2005-2008 Matt Mackall <mpm@selenic.com>
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
"""
# Do not import anything here, please
class RevlogError(Exception):
pass
class LookupError(RevlogError, KeyError):
def __init__(self, name, index, message):
self.name = name
if isinstance(name, str) and len(name) == 20:
from node import short
name = short(name)
RevlogError.__init__(self, '%s@%s: %s' % (index, name, message))
def __str__(self):
return RevlogError.__str__(self)