aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-23 14:46:51 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-23 14:46:51 -0500
commitd80720fcad22215cdbd1f2b39434945364ba11d5 (patch)
tree9fed4e25664eac1669c074cec38f95c8e5a1bdfb /libbe/bugdir.py
parent8517f6856983b81363155e4b8ce58deb549e333b (diff)
downloadbugseverywhere-d80720fcad22215cdbd1f2b39434945364ba11d5.tar.gz
Created bugdir.MultipleBugMatches so bugdir no longer imports cmdutil.
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 0a3e164..e134a2c 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -24,7 +24,6 @@ import doctest
import mapfile
import bug
-import cmdutil
import utility
from rcs import rcs_by_name, detect_rcs, installed_rcs, PathNotInRoot
@@ -52,6 +51,14 @@ class InvalidValue(ValueError):
self.name = name
self.value = value
+class MultipleBugMatches(ValueError):
+ def __init__(self, shortname, matches):
+ msg = ("More than one bug matches %s. "
+ "Please be more specific.\n%s" % shortname, matches)
+ ValueError.__init__(self, msg)
+ self.shortname = shortnamename
+ self.matches = matches
+
TREE_VERSION_STRING = "Bugs Everywhere Tree 1 0\n"
@@ -356,8 +363,7 @@ class BugDir (list):
if uuid.startswith(shortname):
matches.append(uuid)
if len(matches) > 1:
- raise cmdutil.UserError("More than one bug matches %s. "
- "Please be more specific." % shortname)
+ raise MultipleBugMatches(shortname, matches)
if len(matches) == 1:
return self.bug_from_uuid(matches[0])
raise KeyError("No bug matches %s" % shortname)