Commit c215f92c authored by ojan@chromium.org's avatar ojan@chromium.org
Browse files

2011-01-18 Ojan Vafai <ojan@chromium.org>

        Reviewed by Eric Seidel.

        make file expansion use the file at the svn revision the diff was created at
        https://bugs.webkit.org/show_bug.cgi?id=52650

        This only works for patches created with SVN for now since the git
        diff does not include SVN revision numbers in it.

        * PrettyPatch/PrettyPatch.rb:
        * code-review.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bd3302dc
2011-01-18 Ojan Vafai <ojan@chromium.org>
Reviewed by Eric Seidel.
make file expansion use the file at the svn revision the diff was created at
https://bugs.webkit.org/show_bug.cgi?id=52650
This only works for patches created with SVN for now since the git
diff does not include SVN revision numbers in it.
* PrettyPatch/PrettyPatch.rb:
* code-review.js:
2011-01-15 Adam Barth <abarth@webkit.org>
Rubber-stamped by Eric Seidel.
......
......@@ -409,7 +409,7 @@ body {
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="code-review.js?version=24"></script>
<script src="code-review.js?version=25"></script>
EOF
def self.revisionOrDescription(string)
......@@ -516,6 +516,11 @@ EOF
else
str += @sections.collect{ |section| section.to_html }.join("<br>\n") unless @sections.nil?
end
if @from then
str += "<span class='revision'>" + @from + "</span>"
end
str += "</div>\n"
end
......
......@@ -408,6 +408,11 @@
convertAllFileDiffs(difftype, file_diffs);
}
function patchRevision() {
var revision = $('.revision');
return revision[0] ? revision.first().text() : null;
}
function getWebKitSourceFile(file_name, onLoad, expand_bar) {
function handleLoad(contents) {
original_file_contents[file_name] = contents.split('\n');
......@@ -415,8 +420,11 @@
onLoad();
};
var revision = patchRevision();
var queryParameters = revision ? '?p=' + revision : '';
$.ajax({
url: WEBKIT_BASE_DIR + file_name,
url: WEBKIT_BASE_DIR + file_name + queryParameters,
context: document.body,
complete: function(xhr, data) {
if (xhr.status == 0)
......@@ -432,9 +440,6 @@
}
function handleLoadError(expand_bar) {
// FIXME: In this case, try fetching the source file at the revision the patch was created at,
// in case the file has bee deleted.
// Might need to modify webkit-patch to include that data in the diff.
replaceExpandLinkContainers(expand_bar, "Can't expand. Is this a new or deleted file?");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment