aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/command')
-rw-r--r--libbe/command/assign.py2
-rw-r--r--libbe/command/base.py3
-rw-r--r--libbe/command/comment.py8
-rw-r--r--libbe/command/depend.py8
-rw-r--r--libbe/command/list.py6
5 files changed, 17 insertions, 10 deletions
diff --git a/libbe/command/assign.py b/libbe/command/assign.py
index ed03a88..0b3f407 100644
--- a/libbe/command/assign.py
+++ b/libbe/command/assign.py
@@ -84,6 +84,8 @@ class Assign (libbe.command.Command):
libbe.command.util.bug_comment_from_user_id(bugdir, bug_id)
if bug.assigned != assigned:
bug.assigned = assigned
+ if bug.status == 'open':
+ bug.status = 'assigned'
return 0
def _long_help(self):
diff --git a/libbe/command/base.py b/libbe/command/base.py
index 307be12..b5f5a22 100644
--- a/libbe/command/base.py
+++ b/libbe/command/base.py
@@ -335,7 +335,8 @@ class Command (object):
def complete(self, argument=None, fragment=None):
if argument == None:
- ret = ['--%s' % o.name for o in self.options]
+ ret = ['--%s' % o.name for o in self.options
+ if o.name != 'complete']
if len(self.args) > 0 and self.args[0].completion_callback != None:
ret.extend(self.args[0].completion_callback(self, argument, fragment))
return ret
diff --git a/libbe/command/comment.py b/libbe/command/comment.py
index f6949da..d182840 100644
--- a/libbe/command/comment.py
+++ b/libbe/command/comment.py
@@ -124,11 +124,13 @@ class Comment (libbe.command.Command):
# try to launch an editor for comment-body entry
try:
if parent == bug.comment_root:
- parent_body = bug.summary+'\n'
+ header = "Subject: %s" % bug.summary
+ parent_body = parent.string_thread() or "No comments"
else:
+ header = "From: %s\nTo: %s" % (parent.author, bug)
parent_body = parent.body
- estr = 'Please enter your comment above\n\n> %s\n' \
- % ('\n> '.join(parent_body.splitlines()))
+ estr = 'Please enter your comment above\n\n%s\n\n> %s\n' \
+ % (header, '\n> '.join(parent_body.splitlines()))
body = libbe.ui.util.editor.editor_string(estr)
except libbe.ui.util.editor.CantFindEditor, e:
raise libbe.command.UserError(
diff --git a/libbe/command/depend.py b/libbe/command/depend.py
index 39d8042..9ae449a 100644
--- a/libbe/command/depend.py
+++ b/libbe/command/depend.py
@@ -84,11 +84,11 @@ def parse_status(status):
return status
def parse_severity(severity, important=False):
- if severity == 'all':
- severity = libbe.bug.severity_values
- elif important == True:
+ if important == True:
serious = libbe.bug.severity_values.index('serious')
- severity.append(list(libbe.bug.severity_values[serious:]))
+ severity = list(libbe.bug.severity_values[serious:])
+ elif severity == 'all':
+ severity = libbe.bug.severity_values
else:
severity = libbe.command.util.select_values(
severity, libbe.bug.severity_values)
diff --git a/libbe/command/list.py b/libbe/command/list.py
index c395997..9eda277 100644
--- a/libbe/command/list.py
+++ b/libbe/command/list.py
@@ -156,7 +156,7 @@ class List (libbe.command.Command):
raise libbe.command.UserError(
'Invalid sort on "%s".\nValid sorts:\n %s'
% (cmp, '\n '.join(AVAILABLE_CMPS)))
- cmp_list.append(eval('libbe.bug.cmp_%s' % cmp))
+ cmp_list.append(getattr(libbe.bug, 'cmp_%s' % cmp))
status = parse_status(params['status'])
severity = parse_severity(params['severity'],
important=params['important'])
@@ -179,7 +179,9 @@ class List (libbe.command.Command):
for x in params['extra-strings'].split(',')]
return (cmp_list, status, severity, assigned, extra_strings_regexps)
- def _sort_bugs(self, bugs, cmp_list=[]):
+ def _sort_bugs(self, bugs, cmp_list=None):
+ if cmp_list is None:
+ cmp_list = []
cmp_list.extend(libbe.bug.DEFAULT_CMP_FULL_CMP_LIST)
cmp_fn = libbe.bug.BugCompoundComparator(cmp_list=cmp_list)
bugs.sort(cmp_fn)