aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2011-01-08 20:54:44 -0500
committerChris Ball <cjb@laptop.org>2011-01-08 20:54:44 -0500
commit06e30d93038de9da326e4bc5c5ed7154b83a18e6 (patch)
tree8fb48924e3acb886843d6c3d287d56a74c3601d8
parent0b33ffd2515cbc5d7f5998839338b84b72660386 (diff)
parent73c9f3ebbf945a8a5c1eb398dff1324ffb47ae43 (diff)
downloadbugseverywhere-06e30d93038de9da326e4bc5c5ed7154b83a18e6.tar.gz
Merge commit 'refs/merge-requests/3' of git://gitorious.org/be/be
-rw-r--r--libbe/bug.py6
-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
-rw-r--r--libbe/storage/vcs/git.py2
-rw-r--r--misc/completion/be.bash2
8 files changed, 25 insertions, 12 deletions
diff --git a/libbe/bug.py b/libbe/bug.py
index 737d92d..6d3d836 100644
--- a/libbe/bug.py
+++ b/libbe/bug.py
@@ -799,6 +799,12 @@ cmp_extra_strings = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "extra_strings"
# chronological rankings (newer < older)
cmp_time = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "time", invert=True)
+def cmp_mine(bug_1, bug_2):
+ user_id = libbe.ui.util.user.get_user_id(bug_1.storage)
+ mine_1 = bug_1.assigned != user_id
+ mine_2 = bug_2.assigned != user_id
+ return cmp(mine_1, mine_2)
+
def cmp_comments(bug_1, bug_2):
"""
Compare two bugs' comments lists. Doesn't load any new comments,
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)
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py
index ba98fa8..7c9199d 100644
--- a/libbe/storage/vcs/git.py
+++ b/libbe/storage/vcs/git.py
@@ -143,7 +143,7 @@ class Git(base.VCS):
return output.rstrip('\n').splitlines()
def _vcs_commit(self, commitfile, allow_empty=False):
- args = ['commit', '--all', '--file', commitfile]
+ args = ['commit', '--file', commitfile]
if allow_empty == True:
args.append('--allow-empty')
status,output,error = self._u_invoke_client(*args)
diff --git a/misc/completion/be.bash b/misc/completion/be.bash
index 834bf25..1d3a941 100644
--- a/misc/completion/be.bash
+++ b/misc/completion/be.bash
@@ -32,7 +32,7 @@ _be()
for i in `seq $COMP_CWORD ${#COMP_WORDS[@]}`; do
unset COMP_WORDS[$i];
done
- COMPREPLY=( $( compgen -W "$(be "${COMP_WORDS[@]}" --complete $cur)" -- $cur ) )
+ COMPREPLY=( $( IFS=$'\n' compgen -W "$(be "${COMP_WORDS[@]}" --complete $cur)" -- $cur ) )
fi
}