diff mercurial/cmdutil.py @ 7643:9a1ea6587557

error: move UnknownCommand and AmbiguousCommand
author Matt Mackall <mpm@selenic.com>
date Mon, 12 Jan 2009 11:39:38 -0600
parents 07cb58b8c843
children bd5c37d792e6
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Jan 12 11:28:30 2009 -0600
+++ b/mercurial/cmdutil.py	Mon Jan 12 11:39:38 2009 -0600
@@ -8,16 +8,11 @@
 from node import hex, nullid, nullrev, short
 from i18n import _
 import os, sys, bisect, stat
-import mdiff, bdiff, util, templater, templatefilters, patch, errno
+import mdiff, bdiff, util, templater, templatefilters, patch, errno, error
 import match as _match
 
 revrangesep = ':'
 
-class UnknownCommand(Exception):
-    """Exception raised if command is not in the command table."""
-class AmbiguousCommand(Exception):
-    """Exception raised if command shortcut matches more than one command."""
-
 def findpossible(cmd, table, strict=False):
     """
     Return cmd -> (aliases, command table entry)
@@ -57,12 +52,12 @@
     if len(choice) > 1:
         clist = choice.keys()
         clist.sort()
-        raise AmbiguousCommand(cmd, clist)
+        raise error.AmbiguousCommand(cmd, clist)
 
     if choice:
         return choice.values()[0]
 
-    raise UnknownCommand(cmd)
+    raise error.UnknownCommand(cmd)
 
 def bail_if_changed(repo):
     if repo.dirstate.parents()[1] != nullid: