changeset 4807:14bd5dc3010b

pullrequests: don't include repo name in default PR title if it is same same
author Mads Kiilerich <madski@unity3d.com>
date Wed, 11 Feb 2015 02:40:28 +0100
parents ddfb998e3898
children 0aa4b31245e5
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Wed Feb 11 02:40:28 2015 +0100
+++ b/kallithea/controllers/pullrequests.py	Wed Feb 11 02:40:28 2015 +0100
@@ -351,8 +351,12 @@
 
         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(