From: W. Trevor King Date: Thu, 23 Jul 2009 14:10:36 +0000 (-0400) Subject: Merged libbe.diff upgrades and libbe.tree.Tree.has_descendant from be.wtk-rr. X-Git-Tag: 1.0.0~62^2~46^2~9^2~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4fb67ebd5dff9e33e0d2a842cbb102e7d66946d;p=be.git Merged libbe.diff upgrades and libbe.tree.Tree.has_descendant from be.wtk-rr. Also pulls "show referenced text" fix to "be comment". --- e4fb67ebd5dff9e33e0d2a842cbb102e7d66946d diff --cc becommands/comment.py index 9408b09,55b5913..fc30a26 --- a/becommands/comment.py +++ b/becommands/comment.py @@@ -68,10 -68,10 +68,10 @@@ def execute(args, manipulate_encodings= 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] @@@ -79,9 -79,9 +79,9 @@@ 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: @@@ -89,10 -89,16 +89,16 @@@ 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: @@@ -111,7 -117,7 +117,7 @@@ body = args[1] if not body.endswith('\n'): body+='\n' -- ++ if options.XML == False: new = parent.new_reply(body=body) if options.author != None: