##// 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 org_repo.user.username, c.repo_name))
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 c.other_repos.extend(c.org_repos)
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 #add orginal repo
111 #add orginal repo
110 other_repos_info[org_repo.repo_name] = {
112 other_repos_info[org_repo.repo_name] = {
111 'gravatar': h.gravatar_url(org_repo.user.email, 24),
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 #gather forks and add to this list
118 #gather forks and add to this list
117 for fork in org_repo.forks:
119 for fork in org_repo.forks:
118 c.other_repos.append((fork.repo_name, '%s/%s' % (
120 c.other_repos.append((fork.repo_name, '%s/%s' % (
@@ -120,7 +122,10 b' class PullrequestsController(BaseRepoCon'
120 )
122 )
121 other_repos_info[fork.repo_name] = {
123 other_repos_info[fork.repo_name] = {
122 'gravatar': h.gravatar_url(fork.user.email, 24),
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 #add parents of this fork also
130 #add parents of this fork also
126 if org_repo.parent:
131 if org_repo.parent:
@@ -131,7 +136,10 b' class PullrequestsController(BaseRepoCon'
131 )
136 )
132 other_repos_info[org_repo.parent.repo_name] = {
137 other_repos_info[org_repo.parent.repo_name] = {
133 'gravatar': h.gravatar_url(org_repo.parent.user.email, 24),
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 c.other_repos_info = json.dumps(other_repos_info)
145 c.other_repos_info = json.dumps(other_repos_info)
@@ -140,14 +148,12 b' class PullrequestsController(BaseRepoCon'
140
148
141 @NotAnonymous()
149 @NotAnonymous()
142 def create(self, repo_name):
150 def create(self, repo_name):
143
144 try:
151 try:
145 _form = PullRequestForm()().to_python(request.POST)
152 _form = PullRequestForm()().to_python(request.POST)
146 except formencode.Invalid, errors:
153 except formencode.Invalid, errors:
147 log.error(traceback.format_exc())
154 log.error(traceback.format_exc())
148 if errors.error_dict.get('revisions'):
155 if errors.error_dict.get('revisions'):
149 msg = _('Cannot open a pull request with '
156 msg = 'Revisions: %s' % errors.error_dict['revisions']
150 'empty list of changesets')
151 elif errors.error_dict.get('pullrequest_title'):
157 elif errors.error_dict.get('pullrequest_title'):
152 msg = _('Pull request requires a title with min. 3 chars')
158 msg = _('Pull request requires a title with min. 3 chars')
153 else:
159 else:
@@ -215,7 +221,7 b' class PullrequestsController(BaseRepoCon'
215 other_ref_name,
221 other_ref_name,
216 other_ref_rev) = pull_request.other_ref.split(':')
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 # convert this to rev to prevent changes after book or branch change
225 # convert this to rev to prevent changes after book or branch change
220 org_ref = ('rev', org_ref_rev)
226 org_ref = ('rev', org_ref_rev)
221 other_ref = ('rev', other_ref_rev)
227 other_ref = ('rev', other_ref_rev)
@@ -53,7 +53,7 b''
53 <img id="other_repo_gravatar" alt="gravatar" src=""/>
53 <img id="other_repo_gravatar" alt="gravatar" src=""/>
54 </div>
54 </div>
55 <span style="font-size: 20px">
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 </span>
57 </span>
58 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
58 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
59 </div>
59 </div>
@@ -174,6 +174,7 b''
174 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
174 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
175 YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
175 YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
176 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
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 YUE.on('refresh','click',function(e){
180 YUE.on('refresh','click',function(e){
General Comments 0
You need to be logged in to leave comments. Login now