aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/set_root.py
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-05-18 19:19:39 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-05-18 19:19:39 +0000
commita39937baf1196099eeee198169d55b9b498e9651 (patch)
tree1a63e499aaf00b579d91070994bbd137acea03ac /becommands/set_root.py
parent53f5cced06f25dc49cedf1a3fb181201b727a521 (diff)
downloadbugseverywhere-a39937baf1196099eeee198169d55b9b498e9651.tar.gz
Better errors for bad bug roots
Diffstat (limited to 'becommands/set_root.py')
-rw-r--r--becommands/set_root.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/becommands/set_root.py b/becommands/set_root.py
index 14286e0..0ec4c02 100644
--- a/becommands/set_root.py
+++ b/becommands/set_root.py
@@ -40,6 +40,9 @@ def execute(args):
>>> bd = bugdir.tree_root(dir.name+"/{arch}")
>>> bd.root = dir.name
>>> tests.clean_up()
+ >>> execute(('/highly-unlikely-to-exist',))
+ Traceback (most recent call last):
+ UserError: No such directory: /highly-unlikely-to-exist
"""
if len(args) != 1:
raise cmdutil.UserError("Please supply a directory path")
@@ -48,5 +51,8 @@ def execute(args):
print "Using %s for revision control." % dir_rcs.name
else:
print "No revision control detected."
- bugdir.create_bug_dir(args[0], dir_rcs)
+ try:
+ bugdir.create_bug_dir(args[0], dir_rcs)
+ except bugdir.NoRootEntry:
+ raise cmdutil.UserError("No such directory: %s" % args[0])
print "Directory initialized."