##// END OF EJS Templates
compare: drop unused rev_start and rev_end
Mads Kiilerich -
r3484:75e56353 beta
parent child Browse files
Show More
@@ -91,9 +91,6 b' class CompareController(BaseRepoControll'
91 91 other_repo = request.GET.get('other_repo', org_repo)
92 92 # fulldiff disables cut_off_limit
93 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 94 # partial uses compare_cs.html template directly
98 95 partial = request.environ.get('HTTP_X_PARTIAL_XHR')
99 96 # as_form puts hidden input field with changeset revisions
@@ -133,21 +130,6 b' class CompareController(BaseRepoControll'
133 130 c.org_ref_type = org_ref[0]
134 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 133 c.cs_ranges, ancestor = PullRequestModel().get_compare_data(
152 134 org_repo, org_ref, other_repo, other_ref)
153 135
@@ -265,9 +265,6 b' class PullrequestsController(BaseRepoCon'
265 265 :param pull_request:
266 266 :type pull_request:
267 267 """
268 rev_start = request.GET.get('rev_start')
269 rev_end = request.GET.get('rev_end')
270
271 268 org_repo = pull_request.org_repo
272 269 (org_ref_type,
273 270 org_ref_name,
@@ -279,7 +276,7 b' class PullrequestsController(BaseRepoCon'
279 276 other_ref_rev) = pull_request.other_ref.split(':')
280 277
281 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 280 org_ref = ('rev', org_ref_rev)
284 281 other_ref = ('rev', other_ref_rev)
285 282
@@ -21,9 +21,6 b''
21 21 </div>
22 22 ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
23 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 24 ##ORG
28 25 <div style="float:left">
29 26 <div>
@@ -136,8 +133,7 b''
136 133 other_ref_type='__org_ref_type__',
137 134 other_ref='__org_ref__',
138 135 as_form=True,
139 rev_start=request.GET.get('rev_start',''),
140 rev_end=request.GET.get('rev_end',''))}";
136 )}";
141 137 var org_repo = YUQ('#pull_request_form #org_repo')[0].value;
142 138 var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':');
143 139
@@ -215,20 +215,15 b' class TestCompareController(TestControll'
215 215 cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
216 216 message='commit6', vcs_type='hg', parent=cs4)
217 217
218 rev1 = 'tip'
219 rev2 = 'tip'
220
221 218 response = self.app.get(url(controller='compare', action='index',
222 219 repo_name=repo2.repo_name,
223 org_ref_type="tag",
224 org_ref=rev1,
220 org_ref_type="rev",
221 org_ref=cs1.short_id, # parent of cs2, in repo2
225 222 other_repo=repo1.repo_name,
226 other_ref_type="tag",
227 other_ref=rev2,
228 rev_start=cs2.raw_id,
229 rev_end=cs4.raw_id,
223 other_ref_type="rev",
224 other_ref=cs4.short_id,
230 225 ))
231 response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs2.short_id, repo1.repo_name, cs4.short_id))
226 response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs1.short_id, repo1.repo_name, cs4.short_id))
232 227 response.mustcontain("""Showing 3 commits""")
233 228 response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
234 229
@@ -280,21 +275,15 b' class TestCompareController(TestControll'
280 275 message='commit5', vcs_type='hg', parent=cs3)
281 276 cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
282 277 message='commit6', vcs_type='hg', parent=cs4)
283 rev1 = 'tip'
284 rev2 = 'tip'
285
286 278 response = self.app.get(url(controller='compare', action='index',
287 repo_name=repo2.repo_name,
288 org_ref_type="tag",
289 org_ref=rev1,
290 other_repo=repo1.repo_name,
291 other_ref_type="tag",
292 other_ref=rev2,
293 rev_start=cs3.raw_id,
294 rev_end=cs5.raw_id,
279 repo_name=repo1.repo_name,
280 org_ref_type="rev",
281 org_ref=cs2.short_id, # parent of cs3, not in repo2
282 other_ref_type="rev",
283 other_ref=cs5.short_id,
295 284 ))
296 285
297 response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs3.short_id, repo1.repo_name, cs5.short_id))
286 response.mustcontain('%s@%s -&gt; %s@%s' % (repo1.repo_name, cs2.short_id, repo1.repo_name, cs5.short_id))
298 287 response.mustcontain("""Showing 3 commits""")
299 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