error: add a new UnknownIdentifier error type
authorAugie Fackler <augie@google.com>
Mon, 26 Jan 2015 14:31:01 -0500
changeset 24217 d2b81256db1e
parent 24216 4bb348ae43cb
child 24218 cecaec0e8719
error: add a new UnknownIdentifier error type This will be used by the revset and fileset code to communicate more specific errors to higher levels so that we might be able to offer suggestions about what function might have been similar.
mercurial/error.py
--- a/mercurial/error.py	Mon Nov 24 16:42:49 2014 -0500
+++ b/mercurial/error.py	Mon Jan 26 14:31:01 2015 -0500
@@ -67,6 +67,15 @@
 class ParseError(Exception):
     """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
 
+class UnknownIdentifier(ParseError):
+    """Exception raised when a {rev,file}set references an unknown identifier"""
+
+    def __init__(self, function, symbols):
+        from i18n import _
+        ParseError.__init__(self, _("unknown identifier: %s") % function)
+        self.function = function
+        self.symbols = symbols
+
 class RepoError(Exception):
     def __init__(self, *args, **kw):
         Exception.__init__(self, *args)