aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
diff options
context:
space:
mode:
Diffstat (limited to 'becommands')
-rw-r--r--becommands/assign.py1
-rw-r--r--becommands/close.py2
-rw-r--r--becommands/comment.py6
-rw-r--r--becommands/depend.py4
-rw-r--r--becommands/merge.py4
-rw-r--r--becommands/open.py2
-rw-r--r--becommands/remove.py4
-rw-r--r--becommands/severity.py2
-rw-r--r--becommands/show.py2
-rw-r--r--becommands/status.py2
-rw-r--r--becommands/tag.py2
-rw-r--r--becommands/target.py2
12 files changed, 17 insertions, 16 deletions
diff --git a/becommands/assign.py b/becommands/assign.py
index ba79aac..7b32bdd 100644
--- a/becommands/assign.py
+++ b/becommands/assign.py
@@ -55,6 +55,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug = bd.bug_from_shortname(args[0])
if len(args) == 1:
bug.assigned = bd.user_id
diff --git a/becommands/close.py b/becommands/close.py
index 05bdc10..12848b2 100644
--- a/becommands/close.py
+++ b/becommands/close.py
@@ -43,7 +43,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug.status = "closed"
bd.save()
diff --git a/becommands/comment.py b/becommands/comment.py
index 7bbee2c..14872a3 100644
--- a/becommands/comment.py
+++ b/becommands/comment.py
@@ -32,7 +32,7 @@ def execute(args, manipulate_encodings=True):
>>> os.chdir(bd.root)
>>> execute(["a", "This is a comment about a"], manipulate_encodings=False)
>>> bd._clear_bugs()
- >>> bug = bd.bug_from_shortname("a")
+ >>> bug = cmdutil.bug_from_shortname(bd, "a")
>>> bug.load_comments(load_full=False)
>>> comment = bug.comment_root[0]
>>> print comment.body
@@ -54,7 +54,7 @@ def execute(args, manipulate_encodings=True):
>>> os.environ["EDITOR"] = "echo 'I like cheese' > "
>>> execute(["b"], manipulate_encodings=False)
>>> bd._clear_bugs()
- >>> bug = bd.bug_from_shortname("b")
+ >>> bug = cmdutil.bug_from_shortname(bd, "b")
>>> bug.load_comments(load_full=False)
>>> comment = bug.comment_root[0]
>>> print comment.body
@@ -82,7 +82,7 @@ def execute(args, manipulate_encodings=True):
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(bugname)
+ bug = cmdutil.bug_from_shortname(bd, bugname)
bug.load_comments(load_full=False)
if is_reply:
parent = bug.comment_root.comment_from_shortname(shortname,
diff --git a/becommands/depend.py b/becommands/depend.py
index 201c2ea..fd38bd1 100644
--- a/becommands/depend.py
+++ b/becommands/depend.py
@@ -49,9 +49,9 @@ def execute(args, manipulate_encodings=True):
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bugA = bd.bug_from_shortname(args[0])
+ bugA = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 2:
- bugB = bd.bug_from_shortname(args[1])
+ bugB = cmdutil.bug_from_shortname(bd, args[1])
estrs = bugA.extra_strings
depend_string = "BLOCKED-BY:%s" % bugB.uuid
if options.remove == True:
diff --git a/becommands/merge.py b/becommands/merge.py
index 8e1fd50..6651869 100644
--- a/becommands/merge.py
+++ b/becommands/merge.py
@@ -135,9 +135,9 @@ def execute(args, manipulate_encodings=True):
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bugA = bd.bug_from_shortname(args[0])
+ bugA = cmdutil.bug_from_shortname(bd, args[0])
bugA.load_comments()
- bugB = bd.bug_from_shortname(args[1])
+ bugB = cmdutil.bug_from_shortname(bd, args[1])
bugB.load_comments()
mergeA = bugA.new_comment("Merged from bug %s" % bugB.uuid)
newCommTree = copy.deepcopy(bugB.comment_root)
diff --git a/becommands/open.py b/becommands/open.py
index b98463d..bfb54ea 100644
--- a/becommands/open.py
+++ b/becommands/open.py
@@ -42,7 +42,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError, "Too many arguments."
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug.status = "open"
def get_parser():
diff --git a/becommands/remove.py b/becommands/remove.py
index 884b792..bc7b5ed 100644
--- a/becommands/remove.py
+++ b/becommands/remove.py
@@ -30,7 +30,7 @@ def execute(args, manipulate_encodings=True):
>>> bd._clear_bugs()
>>> try:
... bd.bug_from_shortname("b")
- ... except KeyError:
+ ... except bugdir.NoBugMatches:
... print "Bug not found"
Bug not found
"""
@@ -42,7 +42,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError, "Please specify a bug id."
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bd.remove_bug(bug)
print "Removed bug %s" % bug.uuid
diff --git a/becommands/severity.py b/becommands/severity.py
index d125789..a14a96b 100644
--- a/becommands/severity.py
+++ b/becommands/severity.py
@@ -41,7 +41,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
print bug.severity
elif len(args) == 2:
diff --git a/becommands/show.py b/becommands/show.py
index b7bfe78..bb16fe5 100644
--- a/becommands/show.py
+++ b/becommands/show.py
@@ -73,7 +73,7 @@ def execute(args, manipulate_encodings=True):
is_comment = False
if is_comment == True and options.comments == False:
continue
- bug = bd.bug_from_shortname(bugname)
+ bug = cmdutil.bug_from_shortname(bd, bugname)
if is_comment == False:
if options.XML:
print bug.xml(show_comments=options.comments)
diff --git a/becommands/status.py b/becommands/status.py
index 56cb505..e4db787 100644
--- a/becommands/status.py
+++ b/becommands/status.py
@@ -38,7 +38,7 @@ def execute(args, manipulate_encodings=True):
raise cmdutil.UsageError
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=manipulate_encodings)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
print bug.status
else:
diff --git a/becommands/tag.py b/becommands/tag.py
index 5c4b7a6..e749a31 100644
--- a/becommands/tag.py
+++ b/becommands/tag.py
@@ -93,7 +93,7 @@ def execute(args, manipulate_encodings=True):
if len(tags) > 0:
print '\n'.join(tags)
return
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 2:
given_tag = args[1]
estrs = bug.extra_strings
diff --git a/becommands/target.py b/becommands/target.py
index 541918c..5d0453a 100644
--- a/becommands/target.py
+++ b/becommands/target.py
@@ -54,7 +54,7 @@ def execute(args, manipulate_encodings=True):
if target and isinstance(target,str):
print target
return
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
if bug.target is None:
print "No target assigned."