Created attachment 32422 [details] Patch v1 Reviewed by NOBODY (OOPS!). * Scripts/bugzilla-tool: (bug_id_from_commit_message): Added. Returns a bug id from the commit log message, thus enforcing the need for a bug URL in the message. (PostCommitsAsPatchesToBug.__init__): Updated help description to match new behavior of pulling bug ids from commit log messages instead of from the command line. (PostCommitsAsPatchesToBug.execute): Updated to use bug_id_from_commit_message() to pull bug ids from commit log messages. Also switched from SCM.create_patch() to use SCM.create_patch_from_local_commit() to fix a bug where local repository changes were posted as a patch instead of the specific COMMITISH. * Scripts/modules/bugzilla.py: Import datetime module. (timestamp): Added. Returns a timestamp in the form of "YYYYMMDDhhmmss". (Bugzilla.add_patch_to_bug): Construct a more meaningful patch file name using the bug_id and timestamp(). * Scripts/modules/scm.py: (SCM.create_patch_from_local_commit): Added. (Git.create_patch_from_local_commit): Added. Runs "git diff" to return a patch for the given commit_id. --- 4 files changed, 70 insertions(+), 17 deletions(-)
Created attachment 32428 [details] Patch v2
Created attachment 32452 [details] Patch v3
Comment on attachment 32452 [details] Patch v3 Changes since v2: - Removed --cherry-pick switch after adding it from v1 to v2. User should specify a range if they really want a range instead of having it implied. Changes since v1: - Removed required BUGID argument and replaced with optional -b|--bug-id argument. Read URL from the ChangeLog instead to get the bug id.
Comment on attachment 32452 [details] Patch v3 Changes to WebKitTools/Scripts/modules/bugzilla.py are fantastic, and good to commit as is. Reviewing WebKitTools/Scripts/bugzilla-tool: + commit_ids = tool.scm().commit_ids_from_range_arguments(args, cherry_pick=True) cherry_pick? Seems like that part of your patch was dropped. Looks good.
(In reply to comment #4) > (From update of attachment 32452 [details]) > Reviewing WebKitTools/Scripts/bugzilla-tool: > + commit_ids = tool.scm().commit_ids_from_range_arguments(args, > cherry_pick=True) > > cherry_pick? Seems like that part of your patch was dropped. This is to turn off the behavior in commit_ids_from_range_arguments() that assumes if git-rev-parse only returns a single commit hash that the user must have actually meant commit-hash..HEAD. I think that should be specified explicitly by the user when they run the command.
$ git svn dcommit Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebKitTools/ChangeLog M WebKitTools/Scripts/bugzilla-tool M WebKitTools/Scripts/modules/bugzilla.py M WebKitTools/Scripts/modules/scm.py Committed r45654 http://trac.webkit.org/changeset/45654