Changeset - 75e563531350
[Not reviewed]
beta
0 4 0
Mads Kiilerich - 13 years ago 2013-03-04 17:38:34
madski@unity3d.com
Grafted from: b185aece9714
compare: drop unused rev_start and rev_end
4 files changed with 13 insertions and 49 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/compare.py
Show inline comments
 
@@ -91,9 +91,6 @@ class CompareController(BaseRepoControll
 
        other_repo = request.GET.get('other_repo', org_repo)
 
        # fulldiff disables cut_off_limit
 
        c.fulldiff = request.GET.get('fulldiff')
 
        # only consider this range of changesets
 
        rev_start = request.GET.get('rev_start')
 
        rev_end = request.GET.get('rev_end')
 
        # partial uses compare_cs.html template directly
 
        partial = request.environ.get('HTTP_X_PARTIAL_XHR')
 
        # as_form puts hidden input field with changeset revisions
 
@@ -133,21 +130,6 @@ class CompareController(BaseRepoControll
 
        c.org_ref_type = org_ref[0]
 
        c.other_ref_type = other_ref[0]
 

	
 
        if rev_start and rev_end:
 
            # swap revs with cherry picked ones, save them for display
 
            #org_ref = ('rev', rev_start)
 
            #other_ref = ('rev', rev_end)
 
            c.org_ref = rev_start[:12]
 
            c.other_ref = rev_end[:12]
 
            # get parent of
 
            # rev start to include it in the diff
 
            _cs = other_repo.scm_instance.get_changeset(rev_start)
 
            rev_start = _cs.parents[0].raw_id if _cs.parents else EmptyChangeset().raw_id
 
            org_ref = ('rev', rev_start)
 
            other_ref = ('rev', rev_end)
 
            #if we cherry pick it's not remote, make the other_repo org_repo
 
            org_repo = other_repo
 

	
 
        c.cs_ranges, ancestor = PullRequestModel().get_compare_data(
 
            org_repo, org_ref, other_repo, other_ref)
 

	
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -265,9 +265,6 @@ class PullrequestsController(BaseRepoCon
 
        :param pull_request:
 
        :type pull_request:
 
        """
 
        rev_start = request.GET.get('rev_start')
 
        rev_end = request.GET.get('rev_end')
 

	
 
        org_repo = pull_request.org_repo
 
        (org_ref_type,
 
         org_ref_name,
 
@@ -279,7 +276,7 @@ class PullrequestsController(BaseRepoCon
 
         other_ref_rev) = pull_request.other_ref.split(':')
 

	
 
        # despite opening revisions for bookmarks/branches/tags, we always
 
        # convert this to rev to prevent changes after book or branch change
 
        # convert this to rev to prevent changes after bookmark or branch change
 
        org_ref = ('rev', org_ref_rev)
 
        other_ref = ('rev', other_ref_rev)
 

	
rhodecode/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -21,9 +21,6 @@
 
    </div>
 
    ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
 
    <div style="float:left;padding:0px 30px 30px 30px">
 
        <input type="hidden" name="rev_start" value="${request.GET.get('rev_start')}" />
 
        <input type="hidden" name="rev_end" value="${request.GET.get('rev_end')}" />
 

	
 
        ##ORG
 
        <div style="float:left">
 
            <div>
 
@@ -136,8 +133,7 @@
 
                         other_ref_type='__org_ref_type__',
 
                         other_ref='__org_ref__',
 
                         as_form=True,
 
                         rev_start=request.GET.get('rev_start',''),
 
                         rev_end=request.GET.get('rev_end',''))}";
 
                         )}";
 
      var org_repo = YUQ('#pull_request_form #org_repo')[0].value;
 
      var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':');
 

	
rhodecode/tests/functional/test_compare.py
Show inline comments
 
@@ -215,20 +215,15 @@ class TestCompareController(TestControll
 
        cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
 
                             message='commit6', vcs_type='hg', parent=cs4)
 

	
 
        rev1 = 'tip'
 
        rev2 = 'tip'
 

	
 
        response = self.app.get(url(controller='compare', action='index',
 
                                    repo_name=repo2.repo_name,
 
                                    org_ref_type="tag",
 
                                    org_ref=rev1,
 
                                    org_ref_type="rev",
 
                                    org_ref=cs1.short_id, # parent of cs2, in repo2
 
                                    other_repo=repo1.repo_name,
 
                                    other_ref_type="tag",
 
                                    other_ref=rev2,
 
                                    rev_start=cs2.raw_id,
 
                                    rev_end=cs4.raw_id,
 
                                    other_ref_type="rev",
 
                                    other_ref=cs4.short_id,
 
                                    ))
 
        response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs2.short_id, repo1.repo_name, cs4.short_id))
 
        response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs1.short_id, repo1.repo_name, cs4.short_id))
 
        response.mustcontain("""Showing 3 commits""")
 
        response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
 

	
 
@@ -280,21 +275,15 @@ class TestCompareController(TestControll
 
                             message='commit5', vcs_type='hg', parent=cs3)
 
        cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
 
                             message='commit6', vcs_type='hg', parent=cs4)
 
        rev1 = 'tip'
 
        rev2 = 'tip'
 

	
 
        response = self.app.get(url(controller='compare', action='index',
 
                                    repo_name=repo2.repo_name,
 
                                    org_ref_type="tag",
 
                                    org_ref=rev1,
 
                                    other_repo=repo1.repo_name,
 
                                    other_ref_type="tag",
 
                                    other_ref=rev2,
 
                                    rev_start=cs3.raw_id,
 
                                    rev_end=cs5.raw_id,
 
                                    repo_name=repo1.repo_name,
 
                                    org_ref_type="rev",
 
                                    org_ref=cs2.short_id, # parent of cs3, not in repo2
 
                                    other_ref_type="rev",
 
                                    other_ref=cs5.short_id,
 
                                    ))
 

	
 
        response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs3.short_id, repo1.repo_name, cs5.short_id))
 
        response.mustcontain('%s@%s -&gt; %s@%s' % (repo1.repo_name, cs2.short_id, repo1.repo_name, cs5.short_id))
 
        response.mustcontain("""Showing 3 commits""")
 
        response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
 

	
0 comments (0 inline, 0 general)