##CS
<%include file="compare_commits.html"/>
-
- ## FILES
-
-
- ${_('Expand All')} | ${_('Collapse All')}
-
-
- ${diff_block.diff_summary_text(len(c.files), c.lines_added, c.lines_deleted, c.limited_diff)}
-
-
-
- %if not c.files:
-
${_('No files')}
- %endif
-
- <%namespace name="diff_block" file="/changeset/diff_block.html"/>
- %for FID, change, path, stats, file in c.files:
-
-
-
- |
-
-
- |
-
-
- |
-
- ${h.fancy_file_stats(stats)}
-
- |
-
-
- |
- |
-
- %if c.target_repo.repo_name == c.repo_name:
- ${diff_block.diff_menu(c.repo_name, h.safe_unicode(path), c.source_ref, c.target_ref, change, file)}
- %else:
- ## this is slightly different case later, since the target repo can have this
- ## file in target state than the source repo
- ${diff_block.diff_menu(c.target_repo.repo_name, h.safe_unicode(path), c.source_ref, c.target_ref, change, file)}
- %endif
- |
-
- |
-
-
- |
- |
-
- ${diff_block.diff_block_simple([c.changes[FID]])}
- |
-
- %endfor
-
- % if c.limited_diff:
- ${diff_block.changeset_message()}
- % endif
+ ${cbdiffs.render_diffset(c.diffset)}
%endif
diff --git a/rhodecode/tests/functional/test_changeset.py b/rhodecode/tests/functional/test_changeset.py
--- a/rhodecode/tests/functional/test_changeset.py
+++ b/rhodecode/tests/functional/test_changeset.py
@@ -104,7 +104,7 @@ class TestChangesetController(object):
response.mustcontain(_shorten_commit_id(commit_ids[0]))
response.mustcontain(_shorten_commit_id(commit_ids[1]))
-
+
# svn is special
if backend.alias == 'svn':
response.mustcontain('new file 10644')
@@ -146,7 +146,7 @@ class TestChangesetController(object):
# files op files
response.mustcontain('File no longer present at commit: %s' %
_shorten_commit_id(commit_ids[1]))
-
+
# svn is special
if backend.alias == 'svn':
response.mustcontain('new file 10644')
@@ -158,7 +158,7 @@ class TestChangesetController(object):
response.mustcontain('Added docstrings to vcs.cli') # commit msg
response.mustcontain('Changed theme to ADC theme') # commit msg
- self._check_diff_menus(response)
+ self._check_new_diff_menus(response)
def test_changeset_range(self, backend):
self._check_changeset_range(
@@ -273,7 +273,7 @@ Added a symlink
""" + diffs['svn'],
}
- def _check_diff_menus(self, response, right_menu=False):
+ def _check_diff_menus(self, response, right_menu=False,):
# diff menus
for elem in ['Show File', 'Unified Diff', 'Side-by-side Diff',
'Raw Diff', 'Download Diff']:
@@ -284,3 +284,16 @@ Added a symlink
for elem in ['Ignore whitespace', 'Increase context',
'Hide comments']:
response.mustcontain(elem)
+
+
+ def _check_new_diff_menus(self, response, right_menu=False,):
+ # diff menus
+ for elem in ['Show file before', 'Show file after',
+ 'Raw diff', 'Download diff']:
+ response.mustcontain(elem)
+
+ # right pane diff menus
+ if right_menu:
+ for elem in ['Ignore whitespace', 'Increase context',
+ 'Hide comments']:
+ response.mustcontain(elem)
diff --git a/rhodecode/tests/functional/test_compare.py b/rhodecode/tests/functional/test_compare.py
--- a/rhodecode/tests/functional/test_compare.py
+++ b/rhodecode/tests/functional/test_compare.py
@@ -20,6 +20,7 @@
import mock
import pytest
+import lxml.html
from rhodecode.lib.vcs.backends.base import EmptyCommit
from rhodecode.lib.vcs.exceptions import RepositoryRequirementError
@@ -609,9 +610,12 @@ class ComparePage(AssertResponse):
"""
def contains_file_links_and_anchors(self, files):
+ doc = lxml.html.fromstring(self.response.body)
for filename, file_id in files:
- self.contains_one_link(filename, '#' + file_id)
self.contains_one_anchor(file_id)
+ diffblock = doc.cssselect('[data-f-path="%s"]' % filename)
+ assert len(diffblock) == 1
+ assert len(diffblock[0].cssselect('a[href="#%s"]' % file_id)) == 1
def contains_change_summary(self, files_changed, inserted, deleted):
template = (
diff --git a/rhodecode/tests/lib/test_codeblocks.py b/rhodecode/tests/lib/test_codeblocks.py
--- a/rhodecode/tests/lib/test_codeblocks.py
+++ b/rhodecode/tests/lib/test_codeblocks.py
@@ -264,19 +264,19 @@ class TestRenderTokenStream(object):
),
(
[('A', '', u'two\n'), ('A', '', u'lines')],
- '