|
@@
-147,14
+147,14
b' collapse_all = len(diffset.files) > coll'
|
|
147
|
%for i, filediff in enumerate(diffset.files):
|
|
147
|
%for i, filediff in enumerate(diffset.files):
|
|
148
|
|
|
148
|
|
|
149
|
<%
|
|
149
|
<%
|
|
150
|
lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
|
|
150
|
lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
|
|
151
|
over_lines_changed_limit = lines_changed > lines_changed_limit
|
|
151
|
over_lines_changed_limit = lines_changed > lines_changed_limit
|
|
152
|
%>
|
|
152
|
%>
|
|
153
|
<input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
|
|
153
|
<input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
|
|
154
|
<div
|
|
154
|
<div
|
|
155
|
class="filediff"
|
|
155
|
class="filediff"
|
|
156
|
data-f-path="${filediff['patch']['filename']}"
|
|
156
|
data-f-path="${filediff.patch['filename']}"
|
|
157
|
id="a_${h.FID('', filediff['patch']['filename'])}">
|
|
157
|
id="a_${h.FID('', filediff.patch['filename'])}">
|
|
158
|
<label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
|
|
158
|
<label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
|
|
159
|
<div class="filediff-collapse-indicator"></div>
|
|
159
|
<div class="filediff-collapse-indicator"></div>
|
|
160
|
${diff_ops(filediff)}
|
|
160
|
${diff_ops(filediff)}
|
|
@@
-162,7
+162,7
b' collapse_all = len(diffset.files) > coll'
|
|
162
|
${diff_menu(filediff, use_comments=use_comments)}
|
|
162
|
${diff_menu(filediff, use_comments=use_comments)}
|
|
163
|
<table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
|
|
163
|
<table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
|
|
164
|
%if not filediff.hunks:
|
|
164
|
%if not filediff.hunks:
|
|
165
|
%for op_id, op_text in filediff['patch']['stats']['ops'].items():
|
|
165
|
%for op_id, op_text in filediff.patch['stats']['ops'].items():
|
|
166
|
<tr>
|
|
166
|
<tr>
|
|
167
|
<td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
|
|
167
|
<td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
|
|
168
|
%if op_id == DEL_FILENODE:
|
|
168
|
%if op_id == DEL_FILENODE:
|
|
@@
-176,7
+176,7
b' collapse_all = len(diffset.files) > coll'
|
|
176
|
</tr>
|
|
176
|
</tr>
|
|
177
|
%endfor
|
|
177
|
%endfor
|
|
178
|
%endif
|
|
178
|
%endif
|
|
179
|
%if filediff.patch['is_limited_diff']:
|
|
179
|
%if filediff.limited_diff:
|
|
180
|
<tr class="cb-warning cb-collapser">
|
|
180
|
<tr class="cb-warning cb-collapser">
|
|
181
|
<td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
|
|
181
|
<td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
|
|
182
|
${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
|
|
182
|
${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
|
|
@@
-322,7
+322,6
b' collapse_all = len(diffset.files) > coll'
|
|
322
|
|
|
322
|
|
|
323
|
<%def name="diff_ops(filediff)">
|
|
323
|
<%def name="diff_ops(filediff)">
|
|
324
|
<%
|
|
324
|
<%
|
|
325
|
stats = filediff['patch']['stats']
|
|
|
|
|
326
|
from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
|
|
325
|
from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
|
|
327
|
MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
|
|
326
|
MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
|
|
328
|
%>
|
|
327
|
%>
|
|
@@
-330,9
+329,9
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
330
|
%if filediff.source_file_path and filediff.target_file_path:
|
|
329
|
%if filediff.source_file_path and filediff.target_file_path:
|
|
331
|
%if filediff.source_file_path != filediff.target_file_path:
|
|
330
|
%if filediff.source_file_path != filediff.target_file_path:
|
|
332
|
## file was renamed, or copied
|
|
331
|
## file was renamed, or copied
|
|
333
|
%if RENAMED_FILENODE in stats['ops']:
|
|
332
|
%if RENAMED_FILENODE in filediff.patch['stats']['ops']:
|
|
334
|
<strong>${filediff.target_file_path}</strong> β¬
<del>${filediff.source_file_path}</del>
|
|
333
|
<strong>${filediff.target_file_path}</strong> β¬
<del>${filediff.source_file_path}</del>
|
|
335
|
%elif COPIED_FILENODE in stats['ops']:
|
|
334
|
%elif COPIED_FILENODE in filediff.patch['stats']['ops']:
|
|
336
|
<strong>${filediff.target_file_path}</strong> β¬
${filediff.source_file_path}
|
|
335
|
<strong>${filediff.target_file_path}</strong> β¬
${filediff.source_file_path}
|
|
337
|
%endif
|
|
336
|
%endif
|
|
338
|
%else:
|
|
337
|
%else:
|
|
@@
-350,19
+349,19
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
350
|
%endif
|
|
349
|
%endif
|
|
351
|
</span>
|
|
350
|
</span>
|
|
352
|
<span class="pill-group" style="float: left">
|
|
351
|
<span class="pill-group" style="float: left">
|
|
353
|
%if filediff.patch['is_limited_diff']:
|
|
352
|
%if filediff.limited_diff:
|
|
354
|
<span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
|
|
353
|
<span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
|
|
355
|
%endif
|
|
354
|
%endif
|
|
356
|
|
|
355
|
|
|
357
|
%if RENAMED_FILENODE in stats['ops']:
|
|
356
|
%if RENAMED_FILENODE in filediff.patch['stats']['ops']:
|
|
358
|
<span class="pill" op="renamed">renamed</span>
|
|
357
|
<span class="pill" op="renamed">renamed</span>
|
|
359
|
%endif
|
|
358
|
%endif
|
|
360
|
|
|
359
|
|
|
361
|
%if COPIED_FILENODE in stats['ops']:
|
|
360
|
%if COPIED_FILENODE in filediff.patch['stats']['ops']:
|
|
362
|
<span class="pill" op="copied">copied</span>
|
|
361
|
<span class="pill" op="copied">copied</span>
|
|
363
|
%endif
|
|
362
|
%endif
|
|
364
|
|
|
363
|
|
|
365
|
%if NEW_FILENODE in stats['ops']:
|
|
364
|
%if NEW_FILENODE in filediff.patch['stats']['ops']:
|
|
366
|
<span class="pill" op="created">created</span>
|
|
365
|
<span class="pill" op="created">created</span>
|
|
367
|
%if filediff['target_mode'].startswith('120'):
|
|
366
|
%if filediff['target_mode'].startswith('120'):
|
|
368
|
<span class="pill" op="symlink">symlink</span>
|
|
367
|
<span class="pill" op="symlink">symlink</span>
|
|
@@
-371,11
+370,11
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
371
|
%endif
|
|
370
|
%endif
|
|
372
|
%endif
|
|
371
|
%endif
|
|
373
|
|
|
372
|
|
|
374
|
%if DEL_FILENODE in stats['ops']:
|
|
373
|
%if DEL_FILENODE in filediff.patch['stats']['ops']:
|
|
375
|
<span class="pill" op="removed">removed</span>
|
|
374
|
<span class="pill" op="removed">removed</span>
|
|
376
|
%endif
|
|
375
|
%endif
|
|
377
|
|
|
376
|
|
|
378
|
%if CHMOD_FILENODE in stats['ops']:
|
|
377
|
%if CHMOD_FILENODE in filediff.patch['stats']['ops']:
|
|
379
|
<span class="pill" op="mode">
|
|
378
|
<span class="pill" op="mode">
|
|
380
|
${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])}
|
|
379
|
${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])}
|
|
381
|
</span>
|
|
380
|
</span>
|
|
@@
-385,17
+384,17
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
385
|
<a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
|
|
384
|
<a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
|
|
386
|
|
|
385
|
|
|
387
|
<span class="pill-group" style="float: right">
|
|
386
|
<span class="pill-group" style="float: right">
|
|
388
|
%if BIN_FILENODE in stats['ops']:
|
|
387
|
%if BIN_FILENODE in filediff.patch['stats']['ops']:
|
|
389
|
<span class="pill" op="binary">binary</span>
|
|
388
|
<span class="pill" op="binary">binary</span>
|
|
390
|
%if MOD_FILENODE in stats['ops']:
|
|
389
|
%if MOD_FILENODE in filediff.patch['stats']['ops']:
|
|
391
|
<span class="pill" op="modified">modified</span>
|
|
390
|
<span class="pill" op="modified">modified</span>
|
|
392
|
%endif
|
|
391
|
%endif
|
|
393
|
%endif
|
|
392
|
%endif
|
|
394
|
%if stats['added']:
|
|
393
|
%if filediff.patch['stats']['added']:
|
|
395
|
<span class="pill" op="added">+${stats['added']}</span>
|
|
394
|
<span class="pill" op="added">+${filediff.patch['stats']['added']}</span>
|
|
396
|
%endif
|
|
395
|
%endif
|
|
397
|
%if stats['deleted']:
|
|
396
|
%if filediff.patch['stats']['deleted']:
|
|
398
|
<span class="pill" op="deleted">-${stats['deleted']}</span>
|
|
397
|
<span class="pill" op="deleted">-${filediff.patch['stats']['deleted']}</span>
|
|
399
|
%endif
|
|
398
|
%endif
|
|
400
|
</span>
|
|
399
|
</span>
|
|
401
|
|
|
400
|
|
|
@@
-408,7
+407,7
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
408
|
<%def name="diff_menu(filediff, use_comments=False)">
|
|
407
|
<%def name="diff_menu(filediff, use_comments=False)">
|
|
409
|
<div class="filediff-menu">
|
|
408
|
<div class="filediff-menu">
|
|
410
|
%if filediff.diffset.source_ref:
|
|
409
|
%if filediff.diffset.source_ref:
|
|
411
|
%if filediff.patch['operation'] in ['D', 'M']:
|
|
410
|
%if filediff.operation in ['D', 'M']:
|
|
412
|
<a
|
|
411
|
<a
|
|
413
|
class="tooltip"
|
|
412
|
class="tooltip"
|
|
414
|
href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
|
|
413
|
href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
|
|
@@
-424,7
+423,7
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
424
|
${_('Show file before')}
|
|
423
|
${_('Show file before')}
|
|
425
|
</span> |
|
|
424
|
</span> |
|
|
426
|
%endif
|
|
425
|
%endif
|
|
427
|
%if filediff.patch['operation'] in ['A', 'M']:
|
|
426
|
%if filediff.operation in ['A', 'M']:
|
|
428
|
<a
|
|
427
|
<a
|
|
429
|
class="tooltip"
|
|
428
|
class="tooltip"
|
|
430
|
href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
|
|
429
|
href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
|
|
@@
-460,10
+459,10
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
460
|
|
|
459
|
|
|
461
|
## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
|
|
460
|
## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
|
|
462
|
%if hasattr(c, 'ignorews_url'):
|
|
461
|
%if hasattr(c, 'ignorews_url'):
|
|
463
|
${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
|
|
462
|
${c.ignorews_url(request.GET, h.FID('', filediff.patch['filename']))}
|
|
464
|
%endif
|
|
463
|
%endif
|
|
465
|
%if hasattr(c, 'context_url'):
|
|
464
|
%if hasattr(c, 'context_url'):
|
|
466
|
${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
|
|
465
|
${c.context_url(request.GET, h.FID('', filediff.patch['filename']))}
|
|
467
|
%endif
|
|
466
|
%endif
|
|
468
|
|
|
467
|
|
|
469
|
%if use_comments:
|
|
468
|
%if use_comments:
|
|
@@
-503,9
+502,9
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
503
|
<%
|
|
502
|
<%
|
|
504
|
old_line_anchor, new_line_anchor = None, None
|
|
503
|
old_line_anchor, new_line_anchor = None, None
|
|
505
|
if line.original.lineno:
|
|
504
|
if line.original.lineno:
|
|
506
|
old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
|
|
505
|
old_line_anchor = diff_line_anchor(hunk.source_file_path, line.original.lineno, 'o')
|
|
507
|
if line.modified.lineno:
|
|
506
|
if line.modified.lineno:
|
|
508
|
new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
|
|
507
|
new_line_anchor = diff_line_anchor(hunk.target_file_path, line.modified.lineno, 'n')
|
|
509
|
%>
|
|
508
|
%>
|
|
510
|
|
|
509
|
|
|
511
|
<tr class="cb-line">
|
|
510
|
<tr class="cb-line">
|
|
@@
-579,9
+578,9
b' from rhodecode.lib.diffs import NEW_FILE'
|
|
579
|
<%
|
|
578
|
<%
|
|
580
|
old_line_anchor, new_line_anchor = None, None
|
|
579
|
old_line_anchor, new_line_anchor = None, None
|
|
581
|
if old_line_no:
|
|
580
|
if old_line_no:
|
|
582
|
old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
|
|
581
|
old_line_anchor = diff_line_anchor(hunk.source_file_path, old_line_no, 'o')
|
|
583
|
if new_line_no:
|
|
582
|
if new_line_no:
|
|
584
|
new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
|
|
583
|
new_line_anchor = diff_line_anchor(hunk.target_file_path, new_line_no, 'n')
|
|
585
|
%>
|
|
584
|
%>
|
|
586
|
<tr class="cb-line">
|
|
585
|
<tr class="cb-line">
|
|
587
|
<td class="cb-data ${action_class(action)}">
|
|
586
|
<td class="cb-data ${action_class(action)}">
|