[Webkit-unassigned] [Bug 27119] bugzilla-tool: Add create-bug command

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 10 22:39:11 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27119


Eric Seidel <eric at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32609|review?                     |review-
               Flag|                            |




--- Comment #9 from Eric Seidel <eric at webkit.org>  2009-07-10 22:39:11 PDT ---
(From update of attachment 32609)
 489         bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text,
options.component, diff_file, "Patch v1", cc=options.cc,
mark_for_review=options.review)

Is "Patch v1" intended there?

You don't have to forward declare in python AFAIK:
bug_title = ""
 476         comment_text = ""

It seems this wants to be its own function:
80             commit_message = tool.scm().commit_message_for_commit(commit_id)
 481             commit_lines = [re.sub('^ {0,8}', '', line, 1) for line in
commit_message.splitlines()]
 482             bug_title = commit_lines[0]
 483             comment_text = "\n".join(commit_lines[1:]) + "\n"
 484             comment_text += "---\n"
 485             comment_text +=
tool.scm().files_changed_summary_for_commit(commit_id)


There seems to be come copy/paste from the previous section:
 503             commit_message = commit_message_for_this_commit(tool.scm())
 504             commit_lines = [re.sub('^ {0,8}', '', line, 1) for line in
commit_message.splitlines()]
 505             bug_title = commit_lines[0]
 506             comment_text = "\n".join(commit_lines[1:]) + "\n"

AGain, no need for forward-declare:
498         bug_title = ""
 499         comment_text = ""

We shoudl just fix all these functions to detect a string and turn it into a
file for Mechanize:
         diff = tool.scm().create_patch()
 509         diff_file = StringIO.StringIO(diff) # create_bug_with_patch
expects a file-like object
 510         bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text,
options.component, diff_file, "Patch v1", cc=options.cc,
mark_for_review=options.review)

You can invert the order of the clauses with:
if len(args) == 0
and use
if len(args) instead.  Doesn't really matter.

r- for the copy/paste code.  Otherwise this seems fine in general.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list