switch_order_of_sbs_diff.diff

Elliot Winkler, 2008-09-15 04:14

Download (1.77 KB)

View differences:

lib/redmine/unified_diff.rb (working copy)
54 54
          @file_name = $2
55 55
          return false
56 56
        elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/
57
          @line_num_l = $5.to_i
58
          @line_num_r = $2.to_i
57
          @line_num_l = $2.to_i
58
          @line_num_r = $5.to_i
59 59
          @parsing = true
60 60
        end
61 61
      else
......
63 63
          @parsing = false
64 64
          return false
65 65
        elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/
66
          @line_num_l = $5.to_i
67
          @line_num_r = $2.to_i
66
          @line_num_l = $2.to_i
67
          @line_num_r = $5.to_i
68 68
        else
69 69
          @nb_line += 1 if parse_line(line, @type)          
70 70
        end
......
116 116
      if line[0, 1] == "+"
117 117
        diff = sbs? type, 'add'
118 118
        @before = 'add'
119
        diff.line_left = escapeHTML line[1..-1]
120
        diff.nb_line_left = @line_num_l
121
        diff.type_diff_left = 'diff_in'
122
        @line_num_l += 1
119
        diff.line_right = escapeHTML line[1..-1]
120
        diff.nb_line_right = @line_num_r
121
        diff.type_diff_right = 'diff_in'
122
        @line_num_r += 1
123 123
        true
124 124
      elsif line[0, 1] == "-"
125 125
        diff = sbs? type, 'remove'
126 126
        @before = 'remove'
127
        diff.line_right = escapeHTML line[1..-1]
128
        diff.nb_line_right = @line_num_r
129
        diff.type_diff_right = 'diff_out'
130
        @line_num_r += 1
127
        diff.line_left = escapeHTML line[1..-1]
128
        diff.nb_line_left = @line_num_l
129
        diff.type_diff_left = 'diff_out'
130
        @line_num_l += 1
131 131
        true
132 132
      elsif line[0, 1] =~ /\s/
133 133
        @before = 'same'