aboutsummaryrefslogtreecommitdiffstats
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
parent8517f6856983b81363155e4b8ce58deb549e333b (diff)
downloadbugseverywhere-d80720fcad22215cdbd1f2b39434945364ba11d5.tar.gz
Created bugdir.MultipleBugMatches so bugdir no longer imports cmdutil.
-rw-r--r--libbe/bugdir.py12
-rw-r--r--libbe/rcs.py1
2 files changed, 9 insertions, 4 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)
diff --git a/libbe/rcs.py b/libbe/rcs.py
index e467943..f222795 100644
--- a/libbe/rcs.py
+++ b/libbe/rcs.py
@@ -25,7 +25,6 @@ import shutil
import unittest
import doctest
-
from utility import Dir, search_parent_directories