<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56863] trunk/WebKitTools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/56863">56863</a></dd>
<dt>Author</dt> <dd>eric@webkit.org</dd>
<dt>Date</dt> <dd>2010-03-31 13:28:18 -0700 (Wed, 31 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>2010-03-31  Adam Barth  &lt;abarth@webkit.org&gt;

        Reviewed by Eric Seidel.

        webkit-patch reads wrong bug url from unified diff context
        https://bugs.webkit.org/show_bug.cgi?id=36477

        Instead of trying to figure out the bug_id from the diff, we should
        just get the information from the Checkout object, which understands
        these concepts.

        * Scripts/webkitpy/common/checkout/api.py:
        * Scripts/webkitpy/common/checkout/commitinfo.py:
        * Scripts/webkitpy/tool/commands/download.py:
        * Scripts/webkitpy/tool/commands/upload.py:
        * Scripts/webkitpy/tool/mocktool.py:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsScriptswebkitpycommoncheckoutapipy">trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py</a></li>
<li><a href="#trunkWebKitToolsScriptswebkitpycommoncheckoutcommitinfopy">trunk/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py</a></li>
<li><a href="#trunkWebKitToolsScriptswebkitpytoolcommandsdownloadpy">trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py</a></li>
<li><a href="#trunkWebKitToolsScriptswebkitpytoolcommandsuploadpy">trunk/WebKitTools/Scripts/webkitpy/tool/commands/upload.py</a></li>
<li><a href="#trunkWebKitToolsScriptswebkitpytoolmocktoolpy">trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/ChangeLog        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -2,6 +2,23 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Eric Seidel.
</span><span class="cx"> 
</span><ins>+        webkit-patch reads wrong bug url from unified diff context
+        https://bugs.webkit.org/show_bug.cgi?id=36477
+
+        Instead of trying to figure out the bug_id from the diff, we should
+        just get the information from the Checkout object, which understands
+        these concepts.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-03-31  Adam Barth  &lt;abarth@webkit.org&gt;
+
+        Reviewed by Eric Seidel.
+
</ins><span class="cx">         webkit-patch commit-queue should land patches optimistically
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=34187
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitToolsScriptswebkitpycommoncheckoutapipy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -75,6 +75,9 @@
</span><span class="cx">         # entries more difficult to wire in if we need to do that in the future.
</span><span class="cx">         return CommitInfo(revision, committer_email, changelog_data)
</span><span class="cx"> 
</span><ins>+    def bug_id_for_revision(self, revision):
+        return self.commit_info_for_revision(revision).bug_id()
+
</ins><span class="cx">     def modified_changelogs(self):
</span><span class="cx">         return [path for path in self._scm.changed_files() if self._is_path_to_changelog(path)]
</span><span class="cx"> 
</span><span class="lines">@@ -96,6 +99,12 @@
</span><span class="cx">         # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
</span><span class="cx">         return CommitMessage(&quot;&quot;.join(changelog_messages).splitlines())
</span><span class="cx"> 
</span><ins>+    def bug_id_for_this_commit(self):
+        try:
+            return parse_bug_id(self.commit_message_for_this_commit())
+        except ScriptError, e:
+            pass # We might not have ChangeLogs.
+
</ins><span class="cx">     def apply_patch(self, patch, force=False):
</span><span class="cx">         # It's possible that the patch was not made from the root directory.
</span><span class="cx">         # We should detect and handle that case.
</span></span></pre></div>
<a id="trunkWebKitToolsScriptswebkitpycommoncheckoutcommitinfopy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> import StringIO
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.common.config.committers import CommitterList
</span><del>-from webkitpy.common.net.bugzilla import parse_bug_id
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class CommitInfo(object):
</span></span></pre></div>
<a id="trunkWebKitToolsScriptswebkitpytoolcommandsdownloadpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> import webkitpy.tool.steps as steps
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.common.checkout.changelog import ChangeLog, view_source_url
</span><del>-from webkitpy.common.net.bugzilla import parse_bug_id
</del><span class="cx"> from webkitpy.common.system.executive import ScriptError
</span><span class="cx"> from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
</span><span class="cx"> from webkitpy.tool.commands.stepsequence import StepSequence
</span><span class="lines">@@ -86,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx">     def _prepare_state(self, options, args, tool):
</span><span class="cx">         return {
</span><del>-            &quot;bug_id&quot; : (args and args[0]) or parse_bug_id(tool.scm().create_patch()),
</del><ins>+            &quot;bug_id&quot; : (args and args[0]) or tool.checkout().bug_id_for_this_commit()
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -244,12 +243,8 @@
</span><span class="cx"> class AbstractRolloutPrepCommand(AbstractSequencedCommand):
</span><span class="cx">     argument_names = &quot;REVISION REASON&quot;
</span><span class="cx"> 
</span><del>-    def _parse_bug_id_from_revision_diff(self, revision):
-        original_diff = self.tool.scm().diff_for_revision(revision)
-        return parse_bug_id(original_diff)
-
</del><span class="cx">     def _bug_id_for_revision(self, revision):
</span><del>-        bug_id = self._parse_bug_id_from_revision_diff(revision)
</del><ins>+        bug_id = self.tool.checkout().bug_id_for_revision(revision)
</ins><span class="cx">         if bug_id:
</span><span class="cx">             log(&quot;Preparing rollout for bug %s.&quot; % bug_id)
</span><span class="cx">             return bug_id
</span></span></pre></div>
<a id="trunkWebKitToolsScriptswebkitpytoolcommandsuploadpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/webkitpy/tool/commands/upload.py (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/webkitpy/tool/commands/upload.py        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/Scripts/webkitpy/tool/commands/upload.py        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -144,15 +144,14 @@
</span><span class="cx">         # Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs).
</span><span class="cx">         bug_id = args and args[0]
</span><span class="cx">         if not bug_id:
</span><del>-            state[&quot;diff&quot;] = tool.scm().create_patch()
-            bug_id = parse_bug_id(state[&quot;diff&quot;])
</del><ins>+            bug_id = tool.checkout().bug_id_for_this_commit()
</ins><span class="cx">         return bug_id
</span><span class="cx"> 
</span><span class="cx">     def _prepare_state(self, options, args, tool):
</span><span class="cx">         state = {}
</span><span class="cx">         state[&quot;bug_id&quot;] = self._bug_id(args, tool, state)
</span><span class="cx">         if not state[&quot;bug_id&quot;]:
</span><del>-            error(&quot;No bug id passed and no bug url found in diff.&quot;)
</del><ins>+            error(&quot;No bug id passed and no bug url found in ChangeLogs.&quot;)
</ins><span class="cx">         return state
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -288,6 +287,7 @@
</span><span class="cx">             tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+# FIXME: This command needs to be brought into the modern age with steps and CommitInfo.
</ins><span class="cx"> class MarkBugFixed(AbstractDeclarativeCommand):
</span><span class="cx">     name = &quot;mark-bug-fixed&quot;
</span><span class="cx">     help_text = &quot;Mark the specified bug as fixed&quot;
</span><span class="lines">@@ -301,6 +301,7 @@
</span><span class="cx">         ]
</span><span class="cx">         AbstractDeclarativeCommand.__init__(self, options=options)
</span><span class="cx"> 
</span><ins>+    # FIXME: We should be using checkout().changelog_entries_for_revision(...) instead here.
</ins><span class="cx">     def _fetch_commit_log(self, tool, svn_revision):
</span><span class="cx">         if not svn_revision:
</span><span class="cx">             return tool.scm().last_svn_commit_log()
</span></span></pre></div>
<a id="trunkWebKitToolsScriptswebkitpytoolmocktoolpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py (56862 => 56863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py        2010-03-31 20:28:09 UTC (rev 56862)
+++ trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py        2010-03-31 20:28:18 UTC (rev 56863)
</span><span class="lines">@@ -378,6 +378,9 @@
</span><span class="cx">             &quot;reviewer&quot;: self._committer_list.committer_by_name(&quot;Darin Adler&quot;),
</span><span class="cx">         })
</span><span class="cx"> 
</span><ins>+    def bug_id_for_revision(self, svn_revision):
+        return 12345
+
</ins><span class="cx">     def modified_changelogs(self):
</span><span class="cx">         # Ideally we'd return something more interesting here.  The problem is
</span><span class="cx">         # that LandDiff will try to actually read the patch from disk!
</span><span class="lines">@@ -392,6 +395,7 @@
</span><span class="cx">     def apply_reverse_diff(self, revision):
</span><span class="cx">         pass
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> class MockUser(object):
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span></span></pre>
</div>
</div>

</body>
</html>