# HG changeset patch # User Mads Kiilerich # Date 2015-02-11 02:40:28 # Node ID 14bd5dc3010b905d354a761a82a7447294bab281 # Parent ddfb998e38983111235fb85baaf8de5407f2e8e9 pullrequests: don't include repo name in default PR title if it is same same diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -351,8 +351,12 @@ class PullrequestsController(BaseRepoCon title = _form['pullrequest_title'] if not title: - 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)) + if org_repo_name == other_repo_name: + title = '%s to %s' % (h.short_ref(org_ref_type, org_ref_name), + h.short_ref(other_ref_type, other_ref_name)) + else: + 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(