changeset 3320:75431548602a beta

fixed broken swap url, and added a test to detect it in feature
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 04 Feb 2013 02:18:44 +0100
parents 6d75dfb6b8ed
children a91fa221a3b8
files rhodecode/controllers/compare.py rhodecode/tests/functional/test_compare.py
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/compare.py	Mon Feb 04 02:07:57 2013 +0100
+++ b/rhodecode/controllers/compare.py	Mon Feb 04 02:18:44 2013 +0100
@@ -96,7 +96,7 @@
         c.swap_url = h.url('compare_url', as_form=request.GET.get('as_form'),
             repo_name=other_repo,
             org_ref_type=other_ref[0], org_ref=other_ref[1],
-            repo=org_repo,
+            other_repo=org_repo,
             other_ref_type=org_ref[0], other_ref=org_ref[1])
 
         c.org_repo = org_repo = Repository.get_by_repo_name(org_repo)
--- a/rhodecode/tests/functional/test_compare.py	Mon Feb 04 02:07:57 2013 +0100
+++ b/rhodecode/tests/functional/test_compare.py	Mon Feb 04 02:18:44 2013 +0100
@@ -109,7 +109,8 @@
             response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
             ## files
             response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name))
-
+            #swap
+            response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?as_form=None&amp;other_repo=%s">[swap]</a>""" % (repo1.repo_name, rev1, rev2, repo2.repo_name))
         finally:
             RepoModel().delete(r2_id)
             RepoModel().delete(r1_id)
@@ -166,7 +167,8 @@
             response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
             ## files
             response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name))
-
+            #swap
+            response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?as_form=None&amp;other_repo=%s">[swap]</a>""" % (repo1.repo_name, rev1, rev2, repo2.repo_name))
         finally:
             RepoModel().delete(r2_id)
             RepoModel().delete(r1_id)