Merged libbe.diff upgrades and libbe.tree.Tree.has_descendant from be.wtk-rr.
authorW. Trevor King <wking@drexel.edu>
Thu, 23 Jul 2009 14:10:36 +0000 (10:10 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 23 Jul 2009 14:10:36 +0000 (10:10 -0400)
Also pulls "show referenced text" fix to "be comment".

1  2 
becommands/comment.py
becommands/diff.py

index 9408b094ed067464be3df3c1cd87f96e77ce32dc,55b5913b8c60a166a2e10ead1ba05e3c576f9bf6..fc30a26bfc2a0fa1503335c46c83a19b9f74280b
@@@ -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:
                                                           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:
Simple merge