raise cmdutil.UsageError("Please specify a bug or comment id.")
if len(args) > 2:
raise cmdutil.UsageError("Too many arguments.")
--
++
shortname = args[0]
if shortname.count(':') > 1:
-- raise cmdutil.UserError("Invalid id '%s'." % shortname)
++ raise cmdutil.UserError("Invalid id '%s'." % shortname)
elif shortname.count(':') == 1:
# Split shortname generated by Comment.comment_shortnames()
bugname = shortname.split(':')[0]
else:
bugname = shortname
is_reply = False
--
++
bd = bugdir.BugDir(from_disk=True,
- manipulate_encodings=not test)
+ manipulate_encodings=manipulate_encodings)
bug = bd.bug_from_shortname(bugname)
bug.load_comments(load_full=False)
if is_reply:
bug_shortname=bugname)
else:
parent = bug.comment_root
--
++
if len(args) == 1: # try to launch an editor for comment-body entry
try:
- body = editor.editor_string("Please enter your comment above")
+ if parent == bug.comment_root:
+ parent_body = bug.summary+"\n"
+ else:
+ parent_body = parent.body
+ estr = "Please enter your comment above\n\n> %s\n" \
+ % ("\n> ".join(parent_body.splitlines()))
+ body = editor.editor_string(estr)
except editor.CantFindEditor, e:
raise cmdutil.UserError, "No comment supplied, and EDITOR not specified."
if body is None:
body = args[1]
if not body.endswith('\n'):
body+='\n'
--
++
if options.XML == False:
new = parent.new_reply(body=body)
if options.author != None: