diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -578,17 +578,17 @@ class PullrequestsController(BaseRepoCon 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])