* viewvc.py
(view_diff): Encapsulate into a single _item parts that would be repeated when multiple "diffable" items will be passed to diff.ezt. At that time, diff will be changed to a sequence. * diff_display.ezt, diff.ezt Prefix those repeatable parts with 'diff'. git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2604 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/property-diff
parent
3e5836cdb4
commit
eba17bcbd7
|
@ -3380,12 +3380,12 @@ def view_diff(request):
|
|||
|
||||
data = common_template_data(request)
|
||||
data.merge(ezt.TemplateData({
|
||||
'left' : left,
|
||||
'right' : right,
|
||||
'raw_diff' : raw_diff_fp,
|
||||
'changes' : changes,
|
||||
'sidebyside': sidebyside,
|
||||
'unified': unified,
|
||||
'diff' : _item(left=left,
|
||||
right=right,
|
||||
raw_diff=raw_diff_fp,
|
||||
changes=changes,
|
||||
sidebyside=sidebyside,
|
||||
unified=unified),
|
||||
'diff_format' : request.query_dict.get('diff_format',
|
||||
cfg.options.diff_format),
|
||||
'patch_href' : request.get_url(view_func=view_patch,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</form>
|
||||
</td>
|
||||
<td>
|
||||
[if-any raw_diff]
|
||||
[if-any diff.raw_diff]
|
||||
|
||||
[else]
|
||||
<table style="border:solid gray 1px;" class="auto">
|
||||
|
@ -37,7 +37,7 @@
|
|||
<td>Legend:<br />
|
||||
<table cellspacing="0" cellpadding="1">
|
||||
<tr>
|
||||
<td style="text-align:center;" class="vc_diff_remove">Removed from v.[left.rev]</td>
|
||||
<td style="text-align:center;" class="vc_diff_remove">Removed from v.[diff.left.rev]</td>
|
||||
<td class="vc_diff_empty"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -45,7 +45,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="vc_diff_empty"> </td>
|
||||
<td style="text-align:center;" class="vc_diff_add">Added in v.[right.rev]</td>
|
||||
<td style="text-align:center;" class="vc_diff_add">Added in v.[diff.right.rev]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
|
|
@ -1,78 +1,78 @@
|
|||
<h3 style="text-align:center;"></h3>
|
||||
|
||||
[if-any raw_diff]
|
||||
<pre class="vc_raw_diff">[raw_diff]</pre>
|
||||
[if-any diff.raw_diff]
|
||||
<pre class="vc_raw_diff">[diff.raw_diff]</pre>
|
||||
[end]
|
||||
|
||||
[define left_view_href][if-any left.prefer_markup][left.view_href][else][if-any left.download_href][left.download_href][end][end][end]
|
||||
[define right_view_href][if-any right.prefer_markup][right.view_href][else][if-any right.download_href][right.download_href][end][end][end]
|
||||
[define left_view_href][if-any diff.left.prefer_markup][diff.left.view_href][else][if-any diff.left.download_href][diff.left.download_href][end][end][end]
|
||||
[define right_view_href][if-any diff.right.prefer_markup][diff.right.view_href][else][if-any diff.right.download_href][diff.right.download_href][end][end][end]
|
||||
|
||||
[if-any changes]
|
||||
[if-any diff.changes]
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr class="vc_diff_header">
|
||||
<th style="width:6%;"></th>
|
||||
<th style="width:47%; vertical-align:top;">
|
||||
[is left.path right.path][else][left.path][end]
|
||||
revision [if-any left_view_href]<a href="[left_view_href]">[end][left.rev][if-any left_view_href]</a>[end][if-any left.author] by <em>[left.author]</em>[end],
|
||||
[left.date]
|
||||
[if-any left.tag]<br />Tag: [left.tag][end]
|
||||
[is diff.left.path diff.right.path][else][diff.left.path][end]
|
||||
revision [if-any left_view_href]<a href="[left_view_href]">[end][diff.left.rev][if-any left_view_href]</a>[end][if-any diff.left.author] by <em>[diff.left.author]</em>[end],
|
||||
[diff.left.date]
|
||||
[if-any diff.left.tag]<br />Tag: [diff.left.tag][end]
|
||||
</th>
|
||||
<th style="width:47%; vertical-align:top;">
|
||||
[is left.path right.path][else][right.path][end]
|
||||
revision [if-any right_view_href]<a href="[right_view_href]">[end][right.rev][if-any right_view_href]</a>[end][if-any right.author] by <em>[right.author]</em>[end],
|
||||
[right.date]
|
||||
[if-any right.tag]<br />Tag: [right.tag][end]
|
||||
[is diff.left.path diff.right.path][else][diff.right.path][end]
|
||||
revision [if-any right_view_href]<a href="[right_view_href]">[end][diff.right.rev][if-any right_view_href]</a>[end][if-any diff.right.author] by <em>[diff.right.author]</em>[end],
|
||||
[diff.right.date]
|
||||
[if-any diff.right.tag]<br />Tag: [diff.right.tag][end]
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
[for changes]
|
||||
[is changes.type "header"]
|
||||
<tr class="vc_diff_chunk_header" id="h[changes.line_info_right]">
|
||||
[for diff.changes]
|
||||
[is diff.changes.type "header"]
|
||||
<tr class="vc_diff_chunk_header" id="h[diff.changes.line_info_right]">
|
||||
<td style="width:6%;"><strong>#</strong></td>
|
||||
<td style="width:47%;">
|
||||
<strong>Line [changes.line_info_left]</strong>
|
||||
<span class="vc_diff_chunk_extra">[changes.line_info_extra]</span>
|
||||
<strong>Line [diff.changes.line_info_left]</strong>
|
||||
<span class="vc_diff_chunk_extra">[diff.changes.line_info_extra]</span>
|
||||
</td>
|
||||
<td style="width:47%;">
|
||||
<strong>Line [changes.line_info_right]</strong>
|
||||
<span class="vc_diff_chunk_extra">[changes.line_info_extra]</span>
|
||||
<strong>Line [diff.changes.line_info_right]</strong>
|
||||
<span class="vc_diff_chunk_extra">[diff.changes.line_info_extra]</span>
|
||||
</td>
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "add"]
|
||||
[is diff.changes.type "add"]
|
||||
<tr>
|
||||
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
|
||||
<td class="vc_diff_line_number" id="l[diff.changes.line_number]">[if-any diff.right.annotate_href]<a href="[diff.right.annotate_href]#l[diff.changes.line_number]">[diff.changes.line_number]</a>[else][diff.changes.line_number][end]</td>
|
||||
<td class="vc_diff_empty"> </td>
|
||||
<td class="vc_diff_add"> [changes.right]</td>
|
||||
<td class="vc_diff_add"> [diff.changes.right]</td>
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "remove"]
|
||||
[is diff.changes.type "remove"]
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="vc_diff_remove"> [changes.left]</td>
|
||||
<td class="vc_diff_remove"> [diff.changes.left]</td>
|
||||
<td class="vc_diff_empty"> </td>
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "change"]
|
||||
[is diff.changes.type "change"]
|
||||
<tr>
|
||||
[if-any changes.have_right]
|
||||
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
|
||||
[if-any diff.changes.have_right]
|
||||
<td class="vc_diff_line_number" id="l[diff.changes.line_number]">[if-any diff.right.annotate_href]<a href="[diff.right.annotate_href]#l[diff.changes.line_number]">[diff.changes.line_number]</a>[else][diff.changes.line_number][end]</td>
|
||||
[else]
|
||||
<td></td>
|
||||
[end]
|
||||
[if-any changes.have_left]
|
||||
<td class="vc_diff_change"> [changes.left]</td>
|
||||
[if-any diff.changes.have_left]
|
||||
<td class="vc_diff_change"> [diff.changes.left]</td>
|
||||
[else]
|
||||
<td class="vc_diff_change_empty"> </td>
|
||||
[end]
|
||||
[if-any changes.have_right]
|
||||
<td class="vc_diff_change"> [changes.right]</td>
|
||||
[if-any diff.changes.have_right]
|
||||
<td class="vc_diff_change"> [diff.changes.right]</td>
|
||||
[else]
|
||||
<td class="vc_diff_change_empty"> </td>
|
||||
[end]
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "no-changes"]
|
||||
[is diff.changes.type "no-changes"]
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<strong>- No changes -</strong><br /> </td>
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "binary-diff"]
|
||||
[is diff.changes.type "binary-diff"]
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
|
@ -90,7 +90,7 @@
|
|||
<strong>- Binary file revisions differ -</strong><br /> </td>
|
||||
</tr>
|
||||
[else]
|
||||
[is changes.type "error"]
|
||||
[is diff.changes.type "error"]
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
|
@ -104,9 +104,9 @@
|
|||
</tr>
|
||||
[else]
|
||||
<tr>
|
||||
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
|
||||
<td class="vc_diff_nochange"> [changes.left]</td>
|
||||
<td class="vc_diff_nochange"> [changes.right]</td>
|
||||
<td class="vc_diff_line_number" id="l[diff.changes.line_number]">[if-any diff.right.annotate_href]<a href="[diff.right.annotate_href]#l[diff.changes.line_number]">[diff.changes.line_number]</a>[else][diff.changes.line_number][end]</td>
|
||||
<td class="vc_diff_nochange"> [diff.changes.left]</td>
|
||||
<td class="vc_diff_nochange"> [diff.changes.right]</td>
|
||||
</tr>
|
||||
[end]
|
||||
[end]
|
||||
|
@ -119,33 +119,33 @@
|
|||
</table>
|
||||
[end]
|
||||
|
||||
[if-any sidebyside]
|
||||
[if-any diff.sidebyside]
|
||||
<table class="vc_idiff">
|
||||
<colgroup><col /><col class="content" /></colgroup>
|
||||
<colgroup><col /><col class="content" /></colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
[is left.path right.path][else][left.path][end]
|
||||
Revision [left.rev]
|
||||
[is diff.left.path diff.right.path][else][diff.left.path][end]
|
||||
Revision [diff.left.rev]
|
||||
</th>
|
||||
<th colspan="2">
|
||||
[is left.path right.path][else][right.path][end]
|
||||
Revision [right.rev]
|
||||
[is diff.left.path diff.right.path][else][diff.right.path][end]
|
||||
Revision [diff.right.rev]
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[for sidebyside]
|
||||
[if-any sidebyside.gap]
|
||||
[for diff.sidebyside]
|
||||
[if-any diff.sidebyside.gap]
|
||||
<tr>
|
||||
<th>…</th><th></th>
|
||||
<th>…</th><th></th>
|
||||
</tr>
|
||||
[end]
|
||||
<tr>
|
||||
[for sidebyside.columns]
|
||||
<th>[sidebyside.columns.line_number]</th><td[if-any sidebyside.columns.line_number][else] class="vc_idiff_empty"[end]>[for sidebyside.columns.segments][if-any sidebyside.columns.segments.type]<span class="vc_idiff_[sidebyside.columns.segments.type]">[sidebyside.columns.segments.text]</span>[else][sidebyside.columns.segments.text][end][end]</td>
|
||||
[for diff.sidebyside.columns]
|
||||
<th>[diff.sidebyside.columns.line_number]</th><td[if-any diff.sidebyside.columns.line_number][else] class="vc_idiff_empty"[end]>[for diff.sidebyside.columns.segments][if-any diff.sidebyside.columns.segments.type]<span class="vc_idiff_[diff.sidebyside.columns.segments.type]">[diff.sidebyside.columns.segments.text]</span>[else][diff.sidebyside.columns.segments.text][end][end]</td>
|
||||
[end]
|
||||
</tr>
|
||||
[end]
|
||||
|
@ -153,18 +153,18 @@
|
|||
</table>
|
||||
[end]
|
||||
|
||||
[if-any unified]
|
||||
[if-any diff.unified]
|
||||
<table class="vc_idiff">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>r[left.rev]</th>
|
||||
<th>r[right.rev]</th>
|
||||
<th>r[diff.left.rev]</th>
|
||||
<th>r[diff.right.rev]</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[for unified]
|
||||
[if-any unified.gap]
|
||||
[for diff.unified]
|
||||
[if-any diff.unified.gap]
|
||||
<tr>
|
||||
<th>…</th>
|
||||
<th>…</th>
|
||||
|
@ -172,9 +172,9 @@
|
|||
</tr>
|
||||
[end]
|
||||
<tr>
|
||||
<th>[unified.left_number]</th>
|
||||
<th>[unified.right_number]</th>
|
||||
<td[if-any unified.type] class="vc_idiff_[unified.type]"[end]>[for unified.segments][if-any unified.segments.type]<span class="vc_idiff_[unified.segments.type]">[unified.segments.text]</span>[else][unified.segments.text][end][end]</td>
|
||||
<th>[diff.unified.left_number]</th>
|
||||
<th>[diff.unified.right_number]</th>
|
||||
<td[if-any diff.unified.type] class="vc_idiff_[diff.unified.type]"[end]>[for diff.unified.segments][if-any diff.unified.segments.type]<span class="vc_idiff_[diff.unified.segments.type]">[diff.unified.segments.text]</span>[else][diff.unified.segments.text][end][end]</td>
|
||||
</tr>
|
||||
[end]
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue