2011-03-10 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

        Reviewed by Adam Roben.

        Formatted Diff for attachment 23920 is mangled
        https://bugs.webkit.org/show_bug.cgi?id=21222

        The mangled diff files mentioned in the bug were using Mac line
        ending and this was causing problems for String#each_line. Now we
        normalize the line endings in patch data before processing it.

        * PrettyPatch/PrettyPatch.rb:

git-svn-id: svn://svn.chromium.org/blink/trunk@80795 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e75543df
2011-03-10 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed by Adam Roben.
Formatted Diff for attachment 23920 is mangled
https://bugs.webkit.org/show_bug.cgi?id=21222
The mangled diff files mentioned in the bug were using Mac line
ending and this was causing problems for String#each_line. Now we
normalize the line endings in patch data before processing it.
* PrettyPatch/PrettyPatch.rb:
2011-03-10 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2011-03-10 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed by Adam Roben. Reviewed by Adam Roben.
......
...@@ -12,6 +12,7 @@ public ...@@ -12,6 +12,7 @@ public
GIT_PATH = "git" GIT_PATH = "git"
def self.prettify(string) def self.prettify(string)
string = normalize_line_ending(string)
fileDiffs = FileDiff.parse(string) fileDiffs = FileDiff.parse(string)
str = HEADER + "\n" str = HEADER + "\n"
...@@ -88,6 +89,10 @@ private ...@@ -88,6 +89,10 @@ private
Websites Websites
] ]
def self.normalize_line_ending(s)
s.gsub /\r\n?/, "\n"
end
def self.find_url_and_path(file_path) def self.find_url_and_path(file_path)
# Search file_path from the bottom up, at each level checking whether # Search file_path from the bottom up, at each level checking whether
# we've found a directory we know exists in the source tree. # we've found a directory we know exists in the source tree.
......
Markdown is supported
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