# HG changeset patch # User Mads Kiilerich # Date 1405704116 -7200 # Node ID 79eb3211cda171d313c3a5dd1c3a71823598724e # Parent 348ecbd25577947cf018e54f1f48d44bd8e1ed8d compare: links from file list to file diff should just use anchor diff -r 348ecbd25577 -r 79eb3211cda1 kallithea/templates/compare/compare_diff.html --- a/kallithea/templates/compare/compare_diff.html Fri Jul 18 18:47:02 2014 +0200 +++ b/kallithea/templates/compare/compare_diff.html Fri Jul 18 19:21:56 2014 +0200 @@ -69,7 +69,7 @@ %endif %for fid, change, f, stat in c.files:
-
${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid, **request.GET.mixed()))}
+
${h.link_to(h.safe_unicode(f), '#' + fid)}
${h.fancy_file_stats(stat)}
%endfor diff -r 348ecbd25577 -r 79eb3211cda1 kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html Fri Jul 18 18:47:02 2014 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_show.html Fri Jul 18 19:21:56 2014 +0200 @@ -250,7 +250,7 @@ %endif %for fid, change, f, stat in c.files:
-
${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}
+
${h.link_to(h.safe_unicode(f),'#' + fid)}
${h.fancy_file_stats(stat)}
%endfor diff -r 348ecbd25577 -r 79eb3211cda1 kallithea/tests/functional/test_compare.py --- a/kallithea/tests/functional/test_compare.py Fri Jul 18 18:47:02 2014 +0200 +++ b/kallithea/tests/functional/test_compare.py Fri Jul 18 19:21:56 2014 +0200 @@ -103,7 +103,7 @@ response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) ## files - response.mustcontain("""file1""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) + response.mustcontain("""file1""") #swap response.mustcontain(""" Swap""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) @@ -151,7 +151,7 @@ response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) ## files - response.mustcontain("""file1""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) + response.mustcontain("""file1""") #swap response.mustcontain(""" Swap""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) @@ -206,7 +206,7 @@ response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) ## files - response.mustcontain("""file1""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) + response.mustcontain("""file1""") #swap response.mustcontain(""" Swap""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) @@ -261,7 +261,7 @@ response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) ## files - response.mustcontain("""file1""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) + response.mustcontain("""file1""") #swap response.mustcontain(""" Swap""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) @@ -419,9 +419,9 @@ response.mustcontain("""r6:%s""" % (HG_FORK, rev2)) ## files - response.mustcontain("""vcs/backends/hg.py""" % (HG_REPO, rev1, rev2, HG_FORK)) - response.mustcontain("""vcs/backends/__init__.py""" % (HG_REPO, rev1, rev2, HG_FORK)) - response.mustcontain("""vcs/backends/base.py""" % (HG_REPO, rev1, rev2, HG_FORK)) + response.mustcontain("""vcs/backends/hg.py""") + response.mustcontain("""vcs/backends/__init__.py""") + response.mustcontain("""vcs/backends/base.py""") def test_compare_remote_branches_git(self): self.log_user() @@ -449,9 +449,9 @@ response.mustcontain("""r6:%s""" % (GIT_FORK, rev2[:12])) ## files - response.mustcontain("""vcs/backends/hg.py""" % (GIT_REPO, rev1, rev2, GIT_FORK)) - response.mustcontain("""vcs/backends/__init__.py""" % (GIT_REPO, rev1, rev2, GIT_FORK)) - response.mustcontain("""vcs/backends/base.py""" % (GIT_REPO, rev1, rev2, GIT_FORK)) + response.mustcontain("""vcs/backends/hg.py""") + response.mustcontain("""vcs/backends/__init__.py""") + response.mustcontain("""vcs/backends/base.py""") def test_org_repo_new_commits_after_forking_simple_diff_hg(self): self.log_user() diff -r 348ecbd25577 -r 79eb3211cda1 kallithea/tests/functional/test_compare_local.py --- a/kallithea/tests/functional/test_compare_local.py Fri Jul 18 18:47:02 2014 +0200 +++ b/kallithea/tests/functional/test_compare_local.py Fri Jul 18 19:21:56 2014 +0200 @@ -29,17 +29,17 @@ response.mustcontain('11 files changed with 94 insertions and 64 deletions') ## files diff - response.mustcontain('''
docs/api/utils/index.rst
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
test_and_report.sh
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
.hgignore
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
.hgtags
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
docs/api/index.rst
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/__init__.py
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/backends/hg.py
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/utils/__init__.py
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/utils/annotate.py
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/utils/diffs.py
''' % (HG_REPO, tag1, tag2)) - response.mustcontain('''
vcs/utils/lazy.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
docs/api/utils/index.rst
''') + response.mustcontain('''
test_and_report.sh
''') + response.mustcontain('''
.hgignore
''') + response.mustcontain('''
.hgtags
''') + response.mustcontain('''
docs/api/index.rst
''') + response.mustcontain('''
vcs/__init__.py
''') + response.mustcontain('''
vcs/backends/hg.py
''') + response.mustcontain('''
vcs/utils/__init__.py
''') + response.mustcontain('''
vcs/utils/annotate.py
''') + response.mustcontain('''
vcs/utils/diffs.py
''') + response.mustcontain('''
vcs/utils/lazy.py
''') def test_compare_tag_git(self): self.log_user() @@ -67,17 +67,17 @@ response.mustcontain('11 files changed with 94 insertions and 64 deletions') #files - response.mustcontain('''docs/api/utils/index.rst''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''test_and_report.sh''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''.hgignore''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''.hgtags''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''docs/api/index.rst''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/__init__.py''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/backends/hg.py''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/utils/__init__.py''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/utils/annotate.py''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/utils/diffs.py''' % (GIT_REPO, tag1, tag2)) - response.mustcontain('''vcs/utils/lazy.py''' % (GIT_REPO, tag1, tag2)) + response.mustcontain('''docs/api/utils/index.rst''') + response.mustcontain('''test_and_report.sh''') + response.mustcontain('''.hgignore''') + response.mustcontain('''.hgtags''') + response.mustcontain('''docs/api/index.rst''') + response.mustcontain('''vcs/__init__.py''') + response.mustcontain('''vcs/backends/hg.py''') + response.mustcontain('''vcs/utils/__init__.py''') + response.mustcontain('''vcs/utils/annotate.py''') + response.mustcontain('''vcs/utils/diffs.py''') + response.mustcontain('''vcs/utils/lazy.py''') def test_index_branch_hg(self): self.log_user() @@ -131,7 +131,7 @@ response.mustcontain('1 file changed with 7 insertions and 0 deletions') ## files - response.mustcontain(""".hgignore""" % (HG_REPO, rev1, rev2)) + response.mustcontain(""".hgignore""") def test_compare_revisions_git(self): self.log_user() @@ -153,4 +153,4 @@ response.mustcontain('1 file changed with 7 insertions and 0 deletions') ## files - response.mustcontain(""".hgignore""" % (GIT_REPO, rev1, rev2)) + response.mustcontain(""".hgignore""")