changeset 5448:666e4d4567f8

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.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 26 Aug 2015 17:28:59 +0200
parents 07bfe091845e
children 43a4f3b285a6
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Wed Aug 26 17:28:59 2015 +0200
+++ b/kallithea/controllers/pullrequests.py	Wed Aug 26 17:28:59 2015 +0200
@@ -246,7 +246,14 @@
         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 @@
             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