changeset 4738:aab03e1449b4

pullrequests: store the 'a' branch name in template context This is not used upstream yet but is useful for customizations. Getting this change in early avoids conflicts when developing other changes.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 06 Jan 2015 00:54:36 +0100
parents 939e797c13c4
children c17d2c466323
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Tue Jan 06 00:54:36 2015 +0100
+++ b/kallithea/controllers/pullrequests.py	Tue Jan 06 00:54:36 2015 +0100
@@ -578,17 +578,17 @@
         if org_scm_instance.alias == 'hg' and c.a_ref_name != 'ancestor':
             if c.cs_ref_type != 'branch':
                 c.cs_branch_name = org_scm_instance.get_changeset(c.cs_ref_name).branch # use ref_type ?
-            other_branch_name = c.a_ref_name
+            c.a_branch_name = c.a_ref_name
             if c.a_ref_type != 'branch':
                 try:
-                    other_branch_name = other_scm_instance.get_changeset(c.a_ref_name).branch # use ref_type ?
+                    c.a_branch_name = other_scm_instance.get_changeset(c.a_ref_name).branch # use ref_type ?
                 except EmptyRepositoryError:
-                    other_branch_name = 'null' # not a branch name ... but close enough
+                    c.a_branch_name = 'null' # not a branch name ... but close enough
             # 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
-            if other_scm_instance._repo.revs('present(%s)::&%s', c.cs_ranges[-1].raw_id, other_branch_name):
-                c.update_msg = _('This pull request has already been merged to %s.') % other_branch_name
+            if other_scm_instance._repo.revs('present(%s)::&%s', c.cs_ranges[-1].raw_id, c.a_branch_name):
+                c.update_msg = _('This pull request has already been merged to %s.') % c.a_branch_name
             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.cs_branch_name, revs[0])