# HG changeset patch # User Mads Kiilerich # Date 2015-08-26 17:28:59 # Node ID 666e4d4567f8b2f59c7b66252a46fc06245203c6 # Parent 07bfe091845e42d6fc0dbc3099d997057a8b14f9 pull requests: make it possible to make a "pull request" for an arbitrary range The parent of the range start will be used as ancestor. The "pr" can thus probably not be merged but will have to be grafted. diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -246,7 +246,14 @@ class PullrequestsController(BaseRepoCon 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') + rev_start = request.GET.get('rev_start') + other_rev = None + if rev_start: + starters = org_repo.get_changeset(rev_start).parents + if starters: + other_rev = starters[0].raw_id + else: + other_rev = org_repo.scm_instance.EMPTY_CHANGESET branch = request.GET.get('branch') c.cs_repos = [(org_repo.repo_name, org_repo.repo_name)] @@ -266,11 +273,11 @@ class PullrequestsController(BaseRepoCon c.a_repos.append((org_repo.parent.repo_name, '%s (parent)' % org_repo.parent.repo_name)) c.a_repo = org_repo.parent c.a_refs, c.default_a_ref = self._get_repo_refs( - org_repo.parent.scm_instance, branch=default_cs_branch) + org_repo.parent.scm_instance, branch=default_cs_branch, rev=other_rev) else: c.a_repo = org_repo - c.a_refs, c.default_a_ref = self._get_repo_refs(org_scm_instance) # without rev and branch + c.a_refs, c.default_a_ref = self._get_repo_refs(org_scm_instance, rev=other_rev) # gather forks and add to this list ... even though it is rare to # request forks to pull from their parent