##// END OF EJS Templates
Load generated revs while switching to other sources of pull-requests....
marcink -
r2720:0f7355d3 beta
parent child Browse files
Show More
@@ -103,16 +103,18 b' class PullrequestsController(BaseRepoCon'
103 103 org_repo.user.username, c.repo_name))
104 104 )
105 105
106 c.other_refs = c.org_refs
106 # add org repo to other so we can open pull request agains itself
107 107 c.other_repos.extend(c.org_repos)
108 108
109 c.default_pull_request = org_repo.repo_name
110 c.default_revs = self._get_repo_refs(org_repo.scm_instance)
109 111 #add orginal repo
110 112 other_repos_info[org_repo.repo_name] = {
111 113 'gravatar': h.gravatar_url(org_repo.user.email, 24),
112 'description': org_repo.description
114 'description': org_repo.description,
115 'revs': h.select('other_ref', '', c.default_revs, class_='refs')
113 116 }
114 117
115 c.default_pull_request = org_repo.repo_name
116 118 #gather forks and add to this list
117 119 for fork in org_repo.forks:
118 120 c.other_repos.append((fork.repo_name, '%s/%s' % (
@@ -120,7 +122,10 b' class PullrequestsController(BaseRepoCon'
120 122 )
121 123 other_repos_info[fork.repo_name] = {
122 124 'gravatar': h.gravatar_url(fork.user.email, 24),
123 'description': fork.description
125 'description': fork.description,
126 'revs': h.select('other_ref', '',
127 self._get_repo_refs(fork.scm_instance),
128 class_='refs')
124 129 }
125 130 #add parents of this fork also
126 131 if org_repo.parent:
@@ -131,7 +136,10 b' class PullrequestsController(BaseRepoCon'
131 136 )
132 137 other_repos_info[org_repo.parent.repo_name] = {
133 138 'gravatar': h.gravatar_url(org_repo.parent.user.email, 24),
134 'description': org_repo.parent.description
139 'description': org_repo.parent.description,
140 'revs': h.select('other_ref', '',
141 self._get_repo_refs(org_repo.parent.scm_instance),
142 class_='refs')
135 143 }
136 144
137 145 c.other_repos_info = json.dumps(other_repos_info)
@@ -140,14 +148,12 b' class PullrequestsController(BaseRepoCon'
140 148
141 149 @NotAnonymous()
142 150 def create(self, repo_name):
143
144 151 try:
145 152 _form = PullRequestForm()().to_python(request.POST)
146 153 except formencode.Invalid, errors:
147 154 log.error(traceback.format_exc())
148 155 if errors.error_dict.get('revisions'):
149 msg = _('Cannot open a pull request with '
150 'empty list of changesets')
156 msg = 'Revisions: %s' % errors.error_dict['revisions']
151 157 elif errors.error_dict.get('pullrequest_title'):
152 158 msg = _('Pull request requires a title with min. 3 chars')
153 159 else:
@@ -215,7 +221,7 b' class PullrequestsController(BaseRepoCon'
215 221 other_ref_name,
216 222 other_ref_rev) = pull_request.other_ref.split(':')
217 223
218 # dispite opening revisions for bookmarks/branches/tags, we always
224 # despite opening revisions for bookmarks/branches/tags, we always
219 225 # convert this to rev to prevent changes after book or branch change
220 226 org_ref = ('rev', org_ref_rev)
221 227 other_ref = ('rev', other_ref_rev)
@@ -53,7 +53,7 b''
53 53 <img id="other_repo_gravatar" alt="gravatar" src=""/>
54 54 </div>
55 55 <span style="font-size: 20px">
56 ${h.select('other_repo',c.default_pull_request ,c.other_repos,class_='refs')}:${h.select('other_ref','',c.other_refs,class_='refs')}
56 ${h.select('other_repo',c.default_pull_request ,c.other_repos,class_='refs')}:${h.select('other_ref','',c.default_revs,class_='refs')}
57 57 </span>
58 58 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
59 59 </div>
@@ -174,6 +174,7 b''
174 174 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
175 175 YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
176 176 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
177 YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
177 178 })
178 179 }
179 180 YUE.on('refresh','click',function(e){
General Comments 0
You need to be logged in to leave comments. Login now