Show More
@@ -88,7 +88,7 b' class TestRepoCommitView(object):' | |||||
88 | response.mustcontain('21 files changed: 943 inserted, 288 deleted') |
|
88 | response.mustcontain('21 files changed: 943 inserted, 288 deleted') | |
89 |
|
89 | |||
90 | # files op files |
|
90 | # files op files | |
91 |
response.mustcontain('File no |
|
91 | response.mustcontain('File not present at commit: %s' % | |
92 | _shorten_commit_id(commit_id)) |
|
92 | _shorten_commit_id(commit_id)) | |
93 |
|
93 | |||
94 | # svn uses a different filename |
|
94 | # svn uses a different filename | |
@@ -133,7 +133,7 b' class TestRepoCommitView(object):' | |||||
133 | response.mustcontain('21 files changed: 943 inserted, 288 deleted') |
|
133 | response.mustcontain('21 files changed: 943 inserted, 288 deleted') | |
134 |
|
134 | |||
135 | # files op files |
|
135 | # files op files | |
136 |
response.mustcontain('File no |
|
136 | response.mustcontain('File not present at commit: %s' % | |
137 | _shorten_commit_id(commit_ids[1])) |
|
137 | _shorten_commit_id(commit_ids[1])) | |
138 | response.mustcontain('Added docstrings to vcs.cli') # commit msg |
|
138 | response.mustcontain('Added docstrings to vcs.cli') # commit msg | |
139 | response.mustcontain('Changed theme to ADC theme') # commit msg |
|
139 | response.mustcontain('Changed theme to ADC theme') # commit msg | |
@@ -163,7 +163,7 b' class TestRepoCommitView(object):' | |||||
163 | response.mustcontain(_shorten_commit_id(commit_ids[1])) |
|
163 | response.mustcontain(_shorten_commit_id(commit_ids[1])) | |
164 |
|
164 | |||
165 | # files op files |
|
165 | # files op files | |
166 |
response.mustcontain('File no |
|
166 | response.mustcontain('File not present at commit: %s' % | |
167 | _shorten_commit_id(commit_ids[1])) |
|
167 | _shorten_commit_id(commit_ids[1])) | |
168 |
|
168 | |||
169 | # svn is special |
|
169 | # svn is special |
@@ -300,6 +300,7 b' class RepoCompareView(RepoAppView):' | |||||
300 | diffset = codeblocks.DiffSet( |
|
300 | diffset = codeblocks.DiffSet( | |
301 | repo_name=source_repo.repo_name, |
|
301 | repo_name=source_repo.repo_name, | |
302 | source_node_getter=codeblocks.diffset_node_getter(source_commit), |
|
302 | source_node_getter=codeblocks.diffset_node_getter(source_commit), | |
|
303 | target_repo_name=self.db_repo_name, | |||
303 | target_node_getter=codeblocks.diffset_node_getter(target_commit), |
|
304 | target_node_getter=codeblocks.diffset_node_getter(target_commit), | |
304 | ) |
|
305 | ) | |
305 | c.diffset = self.path_filter.render_patchset_filtered( |
|
306 | c.diffset = self.path_filter.render_patchset_filtered( |
@@ -377,6 +377,7 b' class DiffSet(object):' | |||||
377 | def __init__(self, highlight_mode=HL_REAL, repo_name=None, |
|
377 | def __init__(self, highlight_mode=HL_REAL, repo_name=None, | |
378 | source_repo_name=None, |
|
378 | source_repo_name=None, | |
379 | source_node_getter=lambda filename: None, |
|
379 | source_node_getter=lambda filename: None, | |
|
380 | target_repo_name=None, | |||
380 | target_node_getter=lambda filename: None, |
|
381 | target_node_getter=lambda filename: None, | |
381 | source_nodes=None, target_nodes=None, |
|
382 | source_nodes=None, target_nodes=None, | |
382 | # files over this size will use fast highlighting |
|
383 | # files over this size will use fast highlighting | |
@@ -390,6 +391,7 b' class DiffSet(object):' | |||||
390 | self.source_nodes = source_nodes or {} |
|
391 | self.source_nodes = source_nodes or {} | |
391 | self.target_nodes = target_nodes or {} |
|
392 | self.target_nodes = target_nodes or {} | |
392 | self.repo_name = repo_name |
|
393 | self.repo_name = repo_name | |
|
394 | self.target_repo_name = target_repo_name or repo_name | |||
393 | self.source_repo_name = source_repo_name or repo_name |
|
395 | self.source_repo_name = source_repo_name or repo_name | |
394 | self.max_file_size_limit = max_file_size_limit |
|
396 | self.max_file_size_limit = max_file_size_limit | |
395 |
|
397 | |||
@@ -402,6 +404,7 b' class DiffSet(object):' | |||||
402 | file_stats={}, |
|
404 | file_stats={}, | |
403 | limited_diff=isinstance(patchset, LimitedDiffContainer), |
|
405 | limited_diff=isinstance(patchset, LimitedDiffContainer), | |
404 | repo_name=self.repo_name, |
|
406 | repo_name=self.repo_name, | |
|
407 | target_repo_name=self.target_repo_name, | |||
405 | source_repo_name=self.source_repo_name, |
|
408 | source_repo_name=self.source_repo_name, | |
406 | source_ref=source_ref, |
|
409 | source_ref=source_ref, | |
407 | target_ref=target_ref, |
|
410 | target_ref=target_ref, | |
@@ -414,6 +417,7 b' class DiffSet(object):' | |||||
414 | target_ref=diffset.target_ref, |
|
417 | target_ref=diffset.target_ref, | |
415 | repo_name=diffset.repo_name, |
|
418 | repo_name=diffset.repo_name, | |
416 | source_repo_name=diffset.source_repo_name, |
|
419 | source_repo_name=diffset.source_repo_name, | |
|
420 | target_repo_name=diffset.target_repo_name, | |||
417 | )) |
|
421 | )) | |
418 | diffset.files.append(filediff) |
|
422 | diffset.files.append(filediff) | |
419 | diffset.changed_files += 1 |
|
423 | diffset.changed_files += 1 |
@@ -443,11 +443,14 b' from rhodecode.lib.diffs import NEW_FILE' | |||||
443 |
|
443 | |||
444 | <%def name="diff_menu(filediff, use_comments=False)"> |
|
444 | <%def name="diff_menu(filediff, use_comments=False)"> | |
445 | <div class="filediff-menu"> |
|
445 | <div class="filediff-menu"> | |
446 | %if filediff.diffset.source_ref: |
|
446 | ||
|
447 | %if filediff.diffset.source_ref: | |||
|
448 | ||||
|
449 | ## FILE BEFORE CHANGES | |||
447 | %if filediff.operation in ['D', 'M']: |
|
450 | %if filediff.operation in ['D', 'M']: | |
448 | <a |
|
451 | <a | |
449 | class="tooltip" |
|
452 | class="tooltip" | |
450 | href="${h.route_path('repo_files',repo_name=filediff.diffset.repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}" |
|
453 | href="${h.route_path('repo_files',repo_name=filediff.diffset.target_repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}" | |
451 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
454 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
452 | > |
|
455 | > | |
453 | ${_('Show file before')} |
|
456 | ${_('Show file before')} | |
@@ -455,11 +458,13 b' from rhodecode.lib.diffs import NEW_FILE' | |||||
455 | %else: |
|
458 | %else: | |
456 | <span |
|
459 | <span | |
457 | class="tooltip" |
|
460 | class="tooltip" | |
458 |
title="${h.tooltip(_('File no |
|
461 | title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
459 | > |
|
462 | > | |
460 | ${_('Show file before')} |
|
463 | ${_('Show file before')} | |
461 | </span> | |
|
464 | </span> | | |
462 | %endif |
|
465 | %endif | |
|
466 | ||||
|
467 | ## FILE AFTER CHANGES | |||
463 | %if filediff.operation in ['A', 'M']: |
|
468 | %if filediff.operation in ['A', 'M']: | |
464 | <a |
|
469 | <a | |
465 | class="tooltip" |
|
470 | class="tooltip" | |
@@ -471,20 +476,21 b' from rhodecode.lib.diffs import NEW_FILE' | |||||
471 | %else: |
|
476 | %else: | |
472 | <span |
|
477 | <span | |
473 | class="tooltip" |
|
478 | class="tooltip" | |
474 |
title="${h.tooltip(_('File no |
|
479 | title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" | |
475 | > |
|
480 | > | |
476 | ${_('Show file after')} |
|
481 | ${_('Show file after')} | |
477 | </span> |
|
482 | </span> | |
478 | %endif |
|
483 | %endif | |
479 |
|
484 | |||
480 |
|
|
485 | % if use_comments: | |
481 |
|
|
486 | | | |
482 |
|
|
487 | <a href="#" onclick="return Rhodecode.comments.toggleComments(this);"> | |
483 |
|
|
488 | <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span> | |
484 |
|
|
489 | </a> | |
485 |
|
|
490 | % endif | |
486 |
|
491 | |||
487 | %endif |
|
492 | %endif | |
|
493 | ||||
488 | </div> |
|
494 | </div> | |
489 | </%def> |
|
495 | </%def> | |
490 |
|
496 |
General Comments 0
You need to be logged in to leave comments.
Login now