diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-21 18:45:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-21 18:45:30 +0000 |
commit | 8cb75be0dbd7bd54fba71fc989fb4e1cbeb746af (patch) | |
tree | cadc3581a7c6338fe9ea558b6b1fc79d3ccd59f7 /lib/redmine/unified_diff.rb | |
parent | b09a18972d0455c77f99dc9cc8d3c7cd5b81b373 (diff) | |
download | redmine-8cb75be0dbd7bd54fba71fc989fb4e1cbeb746af.tar.gz redmine-8cb75be0dbd7bd54fba71fc989fb4e1cbeb746af.zip |
Switch order of current and previous revisions in side-by-side diff (#1903).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1895 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/unified_diff.rb')
-rw-r--r-- | lib/redmine/unified_diff.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb index aa8994454..36a36cba5 100644 --- a/lib/redmine/unified_diff.rb +++ b/lib/redmine/unified_diff.rb @@ -54,8 +54,8 @@ module Redmine @file_name = $2 return false elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/ - @line_num_l = $5.to_i - @line_num_r = $2.to_i + @line_num_l = $2.to_i + @line_num_r = $5.to_i @parsing = true end else @@ -63,8 +63,8 @@ module Redmine @parsing = false return false elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/ - @line_num_l = $5.to_i - @line_num_r = $2.to_i + @line_num_l = $2.to_i + @line_num_r = $5.to_i else @nb_line += 1 if parse_line(line, @type) end @@ -116,18 +116,18 @@ module Redmine if line[0, 1] == "+" diff = sbs? type, 'add' @before = 'add' - diff.line_left = escapeHTML line[1..-1] - diff.nb_line_left = @line_num_l - diff.type_diff_left = 'diff_in' - @line_num_l += 1 + diff.line_right = escapeHTML line[1..-1] + diff.nb_line_right = @line_num_r + diff.type_diff_right = 'diff_in' + @line_num_r += 1 true elsif line[0, 1] == "-" diff = sbs? type, 'remove' @before = 'remove' - diff.line_right = escapeHTML line[1..-1] - diff.nb_line_right = @line_num_r - diff.type_diff_right = 'diff_out' - @line_num_r += 1 + diff.line_left = escapeHTML line[1..-1] + diff.nb_line_left = @line_num_l + diff.type_diff_left = 'diff_out' + @line_num_l += 1 true elsif line[0, 1] =~ /\s/ @before = 'same' |