Show More
@@ -107,12 +107,9 b" def as_html(table_class='code-difftable'" | |||||
107 | 'filename': _safe_id(file_info['filename']), |
|
107 | 'filename': _safe_id(file_info['filename']), | |
108 | 'newline_no': change['new_lineno'] |
|
108 | 'newline_no': change['new_lineno'] | |
109 | } |
|
109 | } | |
110 |
cond_old = |
|
110 | cond_old = change['old_lineno'] | |
111 |
|
|
111 | cond_new = change['new_lineno'] | |
112 |
|
|
112 | no_lineno = not change['old_lineno'] and not change['new_lineno'] | |
113 | change['new_lineno']) |
|
|||
114 | no_lineno = (change['old_lineno'] == '...' and |
|
|||
115 | change['new_lineno'] == '...') |
|
|||
116 | if cond_old: |
|
113 | if cond_old: | |
117 | anchor_old_id = 'id="%s"' % anchor_old |
|
114 | anchor_old_id = 'id="%s"' % anchor_old | |
118 | if cond_new: |
|
115 | if cond_new: | |
@@ -587,8 +584,8 b' def _parse_lines(diff_lines):' | |||||
587 | # skip context only if it's first line |
|
584 | # skip context only if it's first line | |
588 | if int(gr[0]) > 1: |
|
585 | if int(gr[0]) > 1: | |
589 | lines.append({ |
|
586 | lines.append({ | |
590 |
'old_lineno': ' |
|
587 | 'old_lineno': '', | |
591 |
'new_lineno': ' |
|
588 | 'new_lineno': '', | |
592 | 'action': 'context', |
|
589 | 'action': 'context', | |
593 | 'line': line, |
|
590 | 'line': line, | |
594 | }) |
|
591 | }) | |
@@ -632,8 +629,8 b' def _parse_lines(diff_lines):' | |||||
632 | # we need to append to lines, since this is not |
|
629 | # we need to append to lines, since this is not | |
633 | # counted in the line specs of diff |
|
630 | # counted in the line specs of diff | |
634 | lines.append({ |
|
631 | lines.append({ | |
635 |
'old_lineno': ' |
|
632 | 'old_lineno': '', | |
636 |
'new_lineno': ' |
|
633 | 'new_lineno': '', | |
637 | 'action': 'context', |
|
634 | 'action': 'context', | |
638 | 'line': line, |
|
635 | 'line': line, | |
639 | }) |
|
636 | }) |
@@ -295,7 +295,7 b' class TestDiffLib(base.TestController):' | |||||
295 | l.append('%(action)-7s %(new_lineno)3s %(old_lineno)3s %(line)r\n' % d) |
|
295 | l.append('%(action)-7s %(new_lineno)3s %(old_lineno)3s %(line)r\n' % d) | |
296 | s = ''.join(l) |
|
296 | s = ''.join(l) | |
297 | assert s == r''' |
|
297 | assert s == r''' | |
298 |
context |
|
298 | context '@@ -51,6 +51,13 @@\n' | |
299 | unmod 51 51 '<u>\t</u>begin();\n' |
|
299 | unmod 51 51 '<u>\t</u>begin();\n' | |
300 | unmod 52 52 '<u>\t</u>\n' |
|
300 | unmod 52 52 '<u>\t</u>\n' | |
301 | add 53 '<u>\t</u>int foo;<u class="cr"></u>\n' |
|
301 | add 53 '<u>\t</u>int foo;<u class="cr"></u>\n' |
General Comments 0
You need to be logged in to leave comments.
Login now