Changeset - d053efba3c0c
[Not reviewed]
default
0 1 0
Jan Heylen - 11 years ago 2015-03-19 13:13:06
jan.heylen@alcatel-lucent.com
pullrequests: saving raw_id instead of branch in org_ref

This fixes an issue when the pull request is created while the top commit
included is not the tip. In that case, the faulty code would but
branch:default:default as org_ref, that causes the pull request view to show
all commits on that branch instead of the wanted commit(s) only. The fix will
result in a branch:default:1234567890abcdef1234567890abcdef (e.g)
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -313,26 +313,26 @@ class PullrequestsController(BaseRepoCon
 
            h.flash(msg, 'error')
 
            raise HTTPBadRequest
 

	
 
        # heads up: org and other might seem backward here ...
 
        org_repo_name = _form['org_repo']
 
        org_ref = _form['org_ref'] # will have merge_rev as rev but symbolic name
 
        org_repo = RepoModel()._get_repo(org_repo_name)
 
        (org_ref_type,
 
         org_ref_name,
 
         org_rev) = org_ref.split(':')
 
        if org_ref_type == 'rev':
 
            org_ref_type = 'branch'
 
            org_ref_name = org_repo.scm_instance.get_changeset(org_rev).branch
 
            org_ref = '%s:%s:%s' % (org_ref_type, org_ref_name, org_ref_name)
 
            cs = org_repo.scm_instance.get_changeset(org_rev)
 
            org_ref = '%s:%s:%s' % (org_ref_type, cs.branch, cs.raw_id)
 

	
 
        other_repo_name = _form['other_repo']
 
        other_ref = _form['other_ref'] # will have symbolic name and head revision
 
        other_repo = RepoModel()._get_repo(other_repo_name)
 
        (other_ref_type,
 
         other_ref_name,
 
         other_rev) = other_ref.split(':')
 

	
 
        cs_ranges, _cs_ranges_not, ancestor_rev = \
 
            CompareController._get_changesets(org_repo.scm_instance.alias,
 
                                              other_repo.scm_instance, other_rev, # org and other "swapped"
 
                                              org_repo.scm_instance, org_rev,
0 comments (0 inline, 0 general)