Changeset - 10cff43c7bd9
[Not reviewed]
default
0 1 0
Mads Kiilerich - 12 years ago 2013-06-28 11:50:13
madski@unity3d.com
pull requests: store symbolic reference in other_ref ... but ref of ancestor

This both shows correct info and gives correct diff.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -361,25 +361,30 @@ class PullrequestsController(BaseRepoCon
 
                msg = 'Revisions: %s' % errors.error_dict['revisions']
 
            elif errors.error_dict.get('pullrequest_title'):
 
                msg = _('Pull request requires a title with min. 3 chars')
 
            else:
 
                msg = _('Error creating pull request: %s') % errors.msg
 

	
 
            h.flash(msg, 'error')
 
            return redirect(url('pullrequest_home', repo_name=repo_name)) ## would rather just go back to form ...
 

	
 
        org_repo = _form['org_repo']
 
        org_ref = _form['org_ref'] # will end with merge_rev but have symbolic name
 
        other_repo = _form['other_repo']
 
        other_ref = 'rev:ancestor:%s' % _form['ancestor_rev'] # could be calculated from other_ref ...
 
        other_ref = _form['other_ref'] # will have symbolic name and head revision
 
        ancestor_rev = _form['ancestor_rev'] # revision number of ancestor
 
        # hack: ancestor_rev is not an other_ref but we want to show the
 
        # requested destination and have the exact ancestor
 
        other_ref = other_ref.rsplit(':', 1)[0] + ':' + ancestor_rev
 

	
 
        revisions = [x for x in reversed(_form['revisions'])]
 
        reviewers = _form['review_members']
 

	
 
        title = _form['pullrequest_title']
 
        if not title:
 
            title = '%s#%s to %s' % (org_repo, org_ref.split(':', 2)[1], other_repo)
 
        description = _form['pullrequest_desc']
 
        try:
 
            pull_request = PullRequestModel().create(
 
                self.authuser.user_id, org_repo, org_ref, other_repo,
 
                other_ref, revisions, reviewers, title, description
 
            )
0 comments (0 inline, 0 general)