# HG changeset patch # User Mads Kiilerich # Date 2013-03-26 01:23:35 # Node ID 7d47e91dc1aa4b9141e15e87fbc79ca162e1f19a # Parent 9bc0529426406cb9f8e330d2e0e4968f74162999 pullrequests: use default_other_repo_info for the default other_ref selector diff --git a/rhodecode/controllers/pullrequests.py b/rhodecode/controllers/pullrequests.py --- a/rhodecode/controllers/pullrequests.py +++ b/rhodecode/controllers/pullrequests.py @@ -152,7 +152,7 @@ class PullrequestsController(BaseRepoCon # add org repo to other so we can open pull request against itself c.other_repos.extend(c.org_repos) c.default_other_repo = org_repo.repo_name - c.default_other_refs, c.default_other_ref = self._get_repo_refs(org_repo.scm_instance, branch_rev=org_rev) + other_refs, other_ref = self._get_repo_refs(org_repo.scm_instance, branch_rev=org_rev) usr_data = lambda usr: dict(user_id=usr.user_id, username=usr.username, firstname=usr.firstname, @@ -161,8 +161,7 @@ class PullrequestsController(BaseRepoCon other_repos_info[org_repo.repo_name] = { 'user': usr_data(org_repo.user), 'description': org_repo.description, - 'revs': h.select('other_ref', c.default_other_ref, - c.default_other_refs, class_='refs') + 'revs': h.select('other_ref', other_ref, other_refs, class_='refs') } # gather forks and add to this list ... even though it is rare to @@ -179,13 +178,12 @@ class PullrequestsController(BaseRepoCon # add parents of this fork also, but only if it's not empty if org_repo.parent and org_repo.parent.scm_instance.revisions: c.default_other_repo = org_repo.parent.repo_name - c.default_other_refs, c.default_other_ref = self._get_repo_refs(org_repo.parent.scm_instance) + other_refs, other_ref = self._get_repo_refs(org_repo.parent.scm_instance) c.other_repos.append((org_repo.parent.repo_name, org_repo.parent.repo_name)) other_repos_info[org_repo.parent.repo_name] = { 'user': usr_data(org_repo.parent.user), 'description': org_repo.parent.description, - 'revs': h.select('other_ref', c.default_other_ref, - c.default_other_refs, class_='refs') + 'revs': h.select('other_ref', other_ref, other_refs, class_='refs') } c.default_other_repo_info = other_repos_info[c.default_other_repo] diff --git a/rhodecode/templates/pullrequests/pullrequest.html b/rhodecode/templates/pullrequests/pullrequest.html --- a/rhodecode/templates/pullrequests/pullrequest.html +++ b/rhodecode/templates/pullrequests/pullrequest.html @@ -39,7 +39,7 @@ ${self.context_bar('showpullrequest')}
- ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${h.select('other_ref',c.default_other_ref,c.default_other_refs,class_='refs')} + ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']}