Changeset - b5d079b76f72
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-07-24 12:29:08
madski@unity3d.com
pull requests: use org/other repos correctly when checking for update options
1 file changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -213,25 +213,28 @@ class PullrequestsController(BaseRepoCon
 
        c.cs_ranges_org = None # not stored and not important and moving target - could be calculated ...
 
        revs = [ctx.revision for ctx in reversed(c.cs_ranges)]
 
        c.jsdata = json.dumps(graph_data(org_scm_instance, revs))
 

	
 
        c.available = []
 
        c.org_branch_name = c.org_ref_name
 
        other_scm_instance = c.other_repo.scm_instance
 
        if org_scm_instance.alias == 'hg' and c.other_ref_name != 'ancestor':
 
            if c.org_ref_type != 'branch':
 
                c.org_branch_name = org_scm_instance.get_changeset(c.org_ref_name).branch # use ref_type ?
 
            other_branch_name = c.other_ref_name
 
            if c.other_ref_type != 'branch':
 
                other_branch_name = c.other_repo.scm_instance.get_changeset(c.other_ref_name).branch # use ref_type ?
 
                other_branch_name = other_scm_instance.get_changeset(c.other_ref_name).branch # use ref_type ?
 
            # candidates: descendants of old head that are on the right branch
 
            #             and not are the old head itself ...
 
            #             and nothing at all if old head is a descendent of target ref name
 
            arevs = org_scm_instance._repo.revs('%s:: & branch(%s) - %s - (%s&::%s)::',
 
                                                revs[0], c.org_branch_name,
 
                                                revs[0], revs[0], other_branch_name)
 
            c.available = [org_scm_instance.get_changeset(x) for x in arevs]
 
            if other_scm_instance._repo.revs('%s&::%s', revs[0], other_branch_name):
 
                pass
 
            else: # look for children of PR head on source branch in org repo
 
                arevs = org_scm_instance._repo.revs('%s:: & branch(%s) - %s',
 
                                                    revs[0], c.org_branch_name, revs[0])
 
                c.available = [org_scm_instance.get_changeset(x) for x in arevs]
 

	
 
        raw_ids = [x.raw_id for x in c.cs_ranges]
 
        c.cs_comments = c.org_repo.get_comments(raw_ids)
 
        c.statuses = c.org_repo.statuses(raw_ids)
 

	
 
        ignore_whitespace = request.GET.get('ignorews') == '1'
0 comments (0 inline, 0 general)