changeset 3317:b36285f90f89 beta

compare: rename optional compare_url parameter repo to other_repo At the same time it is placed before other_ref_type and other_ref. Just to keep a logical flow and (a new) consistency that will help the next refactoring.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 01 Feb 2013 23:13:10 +0100
parents 3e071379fe60
children 8f987997cffb
files rhodecode/controllers/compare.py rhodecode/templates/base/base.html rhodecode/templates/changelog/changelog.html rhodecode/templates/forks/forks_data.html rhodecode/templates/pullrequests/pullrequest.html rhodecode/tests/functional/test_compare.py
diffstat 6 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/compare.py	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/controllers/compare.py	Fri Feb 01 23:13:10 2013 +0100
@@ -88,15 +88,16 @@
         org_repo = c.rhodecode_db_repo.repo_name
         org_ref = (org_ref_type, org_ref)
         other_ref = (other_ref_type, other_ref)
-        other_repo = request.GET.get('repo', org_repo)
+        other_repo = request.GET.get('other_repo', org_repo)
         c.fulldiff = fulldiff = request.GET.get('fulldiff')
         rev_start = request.GET.get('rev_start')
         rev_end = request.GET.get('rev_end')
 
-        c.swap_url = h.url('compare_url', repo_name=other_repo,
-              org_ref_type=other_ref[0], org_ref=other_ref[1],
-              other_ref_type=org_ref[0], other_ref=org_ref[1],
-              repo=org_repo, as_form=request.GET.get('as_form'))
+        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_ref_type=org_ref[0], other_ref=org_ref[1])
 
         c.org_repo = org_repo = Repository.get_by_repo_name(org_repo)
         c.other_repo = other_repo = Repository.get_by_repo_name(other_repo)
--- a/rhodecode/templates/base/base.html	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/templates/base/base.html	Fri Feb 01 23:13:10 2013 +0100
@@ -220,7 +220,7 @@
                  <li>${h.link_to(_('open new pull request'),h.url('pullrequest_home',repo_name=c.repo_name),class_='pull_request')}</li>
                 %endif
                 %if c.rhodecode_db_repo.fork:
-                 <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name),class_='compare_request')}</li>
+                 <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_repo=c.rhodecode_db_repo.fork.repo_name,other_ref_type='branch',other_ref='default'),class_='compare_request')}</li>
                 %endif
                 <li>${h.link_to(_('lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li>
                 <li>${h.link_to(_('search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li>
--- a/rhodecode/templates/changelog/changelog.html	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/templates/changelog/changelog.html	Fri Feb 01 23:13:10 2013 +0100
@@ -37,7 +37,7 @@
                     <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
 
                     %if c.rhodecode_db_repo.fork:
-                        <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name)}" class="ui-btn small">${_('Compare fork with parent')}</a>
+                        <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_repo=c.rhodecode_db_repo.fork.repo_name,other_ref_type='branch',other_ref='default')}" class="ui-btn small">${_('Compare fork with parent')}</a>
                     %endif
                     %if h.is_hg(c.rhodecode_repo):
                     <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('open new pull request')}</a>
--- a/rhodecode/templates/forks/forks_data.html	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/templates/forks/forks_data.html	Fri Feb 01 23:13:10 2013 +0100
@@ -17,7 +17,7 @@
             <div class="follower_date">${_('forked')} -
                 <span class="tooltip" title="${h.tooltip(h.fmt_date(f.created_on))}"> ${h.age(f.created_on)}</span>
                 <a title="${_('compare fork with %s' % c.repo_name)}"
-                    href="${h.url('compare_url',repo_name=f.repo_name,org_ref_type='branch',org_ref='default',other_ref_type='branch',other_ref='default', repo=c.repo_name)}"
+                    href="${h.url('compare_url',repo_name=f.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref='default')}"
                     class="ui-btn small">${_('Compare fork')}</a>
             </div>
             <div style="border-bottom: 1px solid #DDD;margin:10px 0px 10px 0px"></div>
--- a/rhodecode/templates/pullrequests/pullrequest.html	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/templates/pullrequests/pullrequest.html	Fri Feb 01 23:13:10 2013 +0100
@@ -141,8 +141,8 @@
       var url = "${h.url('compare_url',
                          repo_name='org_repo',
                          org_ref_type='org_ref_type', org_ref='org_ref',
+                         other_repo='other_repo',
                          other_ref_type='other_ref_type', other_ref='other_ref',
-                         repo='other_repo',
                          as_form=True,
                          rev_start=request.GET.get('rev_start',''),
                          rev_end=request.GET.get('rev_end',''))}";
--- a/rhodecode/tests/functional/test_compare.py	Mon Feb 04 02:00:48 2013 +0100
+++ b/rhodecode/tests/functional/test_compare.py	Fri Feb 01 23:13:10 2013 +0100
@@ -92,9 +92,9 @@
                                     repo_name=repo2.repo_name,
                                     org_ref_type="branch",
                                     org_ref=rev1,
+                                    other_repo=repo1.repo_name,
                                     other_ref_type="branch",
                                     other_ref=rev2,
-                                    repo=repo1.repo_name
                                     ))
 
         try:
@@ -150,9 +150,9 @@
                                     repo_name=repo2.repo_name,
                                     org_ref_type="branch",
                                     org_ref=rev1,
+                                    other_repo=repo1.repo_name,
                                     other_ref_type="branch",
                                     other_ref=rev2,
-                                    repo=repo1.repo_name
                                     ))
 
         try: