Show More
@@ -91,9 +91,6 b' class CompareController(BaseRepoControll' | |||||
91 | other_repo = request.GET.get('other_repo', org_repo) |
|
91 | other_repo = request.GET.get('other_repo', org_repo) | |
92 | # fulldiff disables cut_off_limit |
|
92 | # fulldiff disables cut_off_limit | |
93 | c.fulldiff = request.GET.get('fulldiff') |
|
93 | c.fulldiff = request.GET.get('fulldiff') | |
94 | # only consider this range of changesets |
|
|||
95 | rev_start = request.GET.get('rev_start') |
|
|||
96 | rev_end = request.GET.get('rev_end') |
|
|||
97 | # partial uses compare_cs.html template directly |
|
94 | # partial uses compare_cs.html template directly | |
98 | partial = request.environ.get('HTTP_X_PARTIAL_XHR') |
|
95 | partial = request.environ.get('HTTP_X_PARTIAL_XHR') | |
99 | # as_form puts hidden input field with changeset revisions |
|
96 | # as_form puts hidden input field with changeset revisions | |
@@ -133,21 +130,6 b' class CompareController(BaseRepoControll' | |||||
133 | c.org_ref_type = org_ref[0] |
|
130 | c.org_ref_type = org_ref[0] | |
134 | c.other_ref_type = other_ref[0] |
|
131 | c.other_ref_type = other_ref[0] | |
135 |
|
132 | |||
136 | if rev_start and rev_end: |
|
|||
137 | # swap revs with cherry picked ones, save them for display |
|
|||
138 | #org_ref = ('rev', rev_start) |
|
|||
139 | #other_ref = ('rev', rev_end) |
|
|||
140 | c.org_ref = rev_start[:12] |
|
|||
141 | c.other_ref = rev_end[:12] |
|
|||
142 | # get parent of |
|
|||
143 | # rev start to include it in the diff |
|
|||
144 | _cs = other_repo.scm_instance.get_changeset(rev_start) |
|
|||
145 | rev_start = _cs.parents[0].raw_id if _cs.parents else EmptyChangeset().raw_id |
|
|||
146 | org_ref = ('rev', rev_start) |
|
|||
147 | other_ref = ('rev', rev_end) |
|
|||
148 | #if we cherry pick it's not remote, make the other_repo org_repo |
|
|||
149 | org_repo = other_repo |
|
|||
150 |
|
||||
151 | c.cs_ranges, ancestor = PullRequestModel().get_compare_data( |
|
133 | c.cs_ranges, ancestor = PullRequestModel().get_compare_data( | |
152 | org_repo, org_ref, other_repo, other_ref) |
|
134 | org_repo, org_ref, other_repo, other_ref) | |
153 |
|
135 |
@@ -265,9 +265,6 b' class PullrequestsController(BaseRepoCon' | |||||
265 | :param pull_request: |
|
265 | :param pull_request: | |
266 | :type pull_request: |
|
266 | :type pull_request: | |
267 | """ |
|
267 | """ | |
268 | rev_start = request.GET.get('rev_start') |
|
|||
269 | rev_end = request.GET.get('rev_end') |
|
|||
270 |
|
||||
271 | org_repo = pull_request.org_repo |
|
268 | org_repo = pull_request.org_repo | |
272 | (org_ref_type, |
|
269 | (org_ref_type, | |
273 | org_ref_name, |
|
270 | org_ref_name, | |
@@ -279,7 +276,7 b' class PullrequestsController(BaseRepoCon' | |||||
279 | other_ref_rev) = pull_request.other_ref.split(':') |
|
276 | other_ref_rev) = pull_request.other_ref.split(':') | |
280 |
|
277 | |||
281 | # despite opening revisions for bookmarks/branches/tags, we always |
|
278 | # despite opening revisions for bookmarks/branches/tags, we always | |
282 | # convert this to rev to prevent changes after book or branch change |
|
279 | # convert this to rev to prevent changes after bookmark or branch change | |
283 | org_ref = ('rev', org_ref_rev) |
|
280 | org_ref = ('rev', org_ref_rev) | |
284 | other_ref = ('rev', other_ref_rev) |
|
281 | other_ref = ('rev', other_ref_rev) | |
285 |
|
282 |
@@ -21,9 +21,6 b'' | |||||
21 | </div> |
|
21 | </div> | |
22 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} |
|
22 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} | |
23 | <div style="float:left;padding:0px 30px 30px 30px"> |
|
23 | <div style="float:left;padding:0px 30px 30px 30px"> | |
24 | <input type="hidden" name="rev_start" value="${request.GET.get('rev_start')}" /> |
|
|||
25 | <input type="hidden" name="rev_end" value="${request.GET.get('rev_end')}" /> |
|
|||
26 |
|
||||
27 | ##ORG |
|
24 | ##ORG | |
28 | <div style="float:left"> |
|
25 | <div style="float:left"> | |
29 | <div> |
|
26 | <div> | |
@@ -136,8 +133,7 b'' | |||||
136 | other_ref_type='__org_ref_type__', |
|
133 | other_ref_type='__org_ref_type__', | |
137 | other_ref='__org_ref__', |
|
134 | other_ref='__org_ref__', | |
138 | as_form=True, |
|
135 | as_form=True, | |
139 | rev_start=request.GET.get('rev_start',''), |
|
136 | )}"; | |
140 | rev_end=request.GET.get('rev_end',''))}"; |
|
|||
141 | var org_repo = YUQ('#pull_request_form #org_repo')[0].value; |
|
137 | var org_repo = YUQ('#pull_request_form #org_repo')[0].value; | |
142 | var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':'); |
|
138 | var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':'); | |
143 |
|
139 |
@@ -215,20 +215,15 b' class TestCompareController(TestControll' | |||||
215 | cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n', |
|
215 | cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n', | |
216 | message='commit6', vcs_type='hg', parent=cs4) |
|
216 | message='commit6', vcs_type='hg', parent=cs4) | |
217 |
|
217 | |||
218 | rev1 = 'tip' |
|
|||
219 | rev2 = 'tip' |
|
|||
220 |
|
||||
221 | response = self.app.get(url(controller='compare', action='index', |
|
218 | response = self.app.get(url(controller='compare', action='index', | |
222 | repo_name=repo2.repo_name, |
|
219 | repo_name=repo2.repo_name, | |
223 |
org_ref_type=" |
|
220 | org_ref_type="rev", | |
224 |
org_ref= |
|
221 | org_ref=cs1.short_id, # parent of cs2, in repo2 | |
225 | other_repo=repo1.repo_name, |
|
222 | other_repo=repo1.repo_name, | |
226 |
other_ref_type=" |
|
223 | other_ref_type="rev", | |
227 |
other_ref= |
|
224 | other_ref=cs4.short_id, | |
228 | rev_start=cs2.raw_id, |
|
|||
229 | rev_end=cs4.raw_id, |
|
|||
230 | )) |
|
225 | )) | |
231 |
response.mustcontain('%s@%s -> %s@%s' % (repo2.repo_name, cs |
|
226 | response.mustcontain('%s@%s -> %s@%s' % (repo2.repo_name, cs1.short_id, repo1.repo_name, cs4.short_id)) | |
232 | response.mustcontain("""Showing 3 commits""") |
|
227 | response.mustcontain("""Showing 3 commits""") | |
233 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") |
|
228 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") | |
234 |
|
229 | |||
@@ -280,21 +275,15 b' class TestCompareController(TestControll' | |||||
280 | message='commit5', vcs_type='hg', parent=cs3) |
|
275 | message='commit5', vcs_type='hg', parent=cs3) | |
281 | cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n', |
|
276 | cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n', | |
282 | message='commit6', vcs_type='hg', parent=cs4) |
|
277 | message='commit6', vcs_type='hg', parent=cs4) | |
283 | rev1 = 'tip' |
|
|||
284 | rev2 = 'tip' |
|
|||
285 |
|
||||
286 | response = self.app.get(url(controller='compare', action='index', |
|
278 | response = self.app.get(url(controller='compare', action='index', | |
287 |
repo_name=repo |
|
279 | repo_name=repo1.repo_name, | |
288 |
org_ref_type=" |
|
280 | org_ref_type="rev", | |
289 |
org_ref= |
|
281 | org_ref=cs2.short_id, # parent of cs3, not in repo2 | |
290 |
other_re |
|
282 | other_ref_type="rev", | |
291 |
other_ref |
|
283 | other_ref=cs5.short_id, | |
292 | other_ref=rev2, |
|
|||
293 | rev_start=cs3.raw_id, |
|
|||
294 | rev_end=cs5.raw_id, |
|
|||
295 | )) |
|
284 | )) | |
296 |
|
285 | |||
297 |
response.mustcontain('%s@%s -> %s@%s' % (repo |
|
286 | response.mustcontain('%s@%s -> %s@%s' % (repo1.repo_name, cs2.short_id, repo1.repo_name, cs5.short_id)) | |
298 | response.mustcontain("""Showing 3 commits""") |
|
287 | response.mustcontain("""Showing 3 commits""") | |
299 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") |
|
288 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") | |
300 |
|
289 |
General Comments 0
You need to be logged in to leave comments.
Login now