# HG changeset patch # User Mads Kiilerich # Date 1420502076 -3600 # Node ID aab03e1449b4be30e642cbfba4393fea99e4c530 # Parent 939e797c13c4d212aadb055ef9f9a4c836b50906 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. diff -r 939e797c13c4 -r aab03e1449b4 kallithea/controllers/pullrequests.py --- 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])