diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -366,7 +366,7 @@ class PullrequestsController(BaseRepoCon org_repo_name = _form['org_repo'] org_ref = _form['org_ref'] # will have merge_rev as rev but symbolic name org_repo = RepoModel()._get_repo(org_repo_name) - (_org_ref_type, + (org_ref_type, org_ref_name, org_rev) = org_ref.split(':') @@ -392,7 +392,8 @@ class PullrequestsController(BaseRepoCon title = _form['pullrequest_title'] if not title: - title = '%s#%s to %s#%s' % (org_repo_name, org_ref_name, other_repo_name, other_ref_name) + title = '%s#%s to %s#%s' % (org_repo_name, h.short_ref(org_ref_type, org_ref_name), + other_repo_name, h.short_ref(other_ref_type, other_ref_name)) description = _form['pullrequest_desc'].strip() or _('No description') try: pull_request = PullRequestModel().create( diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1379,6 +1379,11 @@ def rst_w_mentions(source): return literal('
%s
' % MarkupRenderer.rst_with_mentions(source)) +def short_ref(ref_type, ref_name): + if ref_type == 'rev': + return short_id(ref_name) + return ref_name + def link_to_ref(repo_name, ref_type, ref_name, rev=None): """ Return full markup for a href to changeset_home for a changeset. @@ -1386,10 +1391,7 @@ def link_to_ref(repo_name, ref_type, ref ref_name is shortened if ref_type is 'rev'. if rev is specified show it too, explicitly linking to that revision. """ - if ref_type == 'rev': - txt = short_id(ref_name) - else: - txt = ref_name + txt = short_ref(ref_type, ref_name) if ref_type == 'branch': u = url('changelog_home', repo_name=repo_name, branch=ref_name) else: