# HG changeset patch # User Mads Kiilerich # Date 2013-03-01 16:16:24 # Node ID b19b1723ff1007d407e6b60cf25ff15c613b4fc6 # Parent 75e563531350f830bab08f6421c57b6f5861c057 pullrequest: pullrequest from changelog view It seems like it didn't work ... perhaps because I broke it. But now we clean it up and make it work: Use rev_end as the revision to merge. We don't know where to merge ... but start_rev cannot be used for that. This might to some extent have been working before ... but we prefer to clean it up and start over again when the normal merge workflow is fully working. diff --git a/rhodecode/controllers/pullrequests.py b/rhodecode/controllers/pullrequests.py --- a/rhodecode/controllers/pullrequests.py +++ b/rhodecode/controllers/pullrequests.py @@ -121,12 +121,17 @@ class PullrequestsController(BaseRepoCon category='warning') redirect(url('summary_home', repo_name=org_repo.repo_name)) + org_rev = request.GET.get('rev_end') + # rev_start is not directly useful - its parent could however be used + # as default for other and thus give a simple compare view + #other_rev = request.POST.get('rev_start') + other_repos_info = {} c.org_repos = [] c.org_repos.append((org_repo.repo_name, org_repo.repo_name)) c.default_org_repo = org_repo.repo_name - c.org_refs, c.default_org_ref = self._get_repo_refs(org_repo.scm_instance) + c.org_refs, c.default_org_ref = self._get_repo_refs(org_repo.scm_instance, org_rev) c.other_repos = [] # add org repo to other so we can open pull request against itself @@ -197,17 +202,6 @@ class PullrequestsController(BaseRepoCon revisions = _form['revisions'] reviewers = _form['review_members'] - # if we have cherry picked pull request we don't care what is in - # org_ref/other_ref - rev_start = request.POST.get('rev_start') - rev_end = request.POST.get('rev_end') - - if rev_start and rev_end: - # this is swapped to simulate that rev_end is a revision from - # parent of the fork - org_ref = 'rev:%s:%s' % (rev_end, rev_end) - other_ref = 'rev:%s:%s' % (rev_start, rev_start) - title = _form['pullrequest_title'] description = _form['pullrequest_desc'] diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -32,7 +32,7 @@
-
+
@@ -160,11 +160,15 @@ } } if(YUD.get('open_new_pr')){ - if(checked_checkboxes.length>0){ - // modify open pull request to show we have selected cs - YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; - }else{ - YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; + if(checked_checkboxes.length>1){ + YUD.setStyle('open_new_pr','display','none'); + } else { + YUD.setStyle('open_new_pr','display',''); + if(checked_checkboxes.length>0){ + YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; + }else{ + YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; + } } } @@ -191,6 +195,7 @@ else{ YUD.setStyle('rev_range_container','display','none'); YUD.setStyle('rev_range_clear','display','none'); + YUD.get('open_new_pr').href = pr_tmpl YUD.setStyle('compare_fork','display',''); } };