changeset 6158:323ccdd4579b

pullrequests: when creating PRs from/to revisions, shorten the visible name Having the long name in the UI was annoying ... and we still have the full hash elsewhere in the 'ref'.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 06 Sep 2016 00:51:18 +0200
parents 470fac079543
children 7c917e15c045
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Tue Sep 06 00:51:18 2016 +0200
+++ b/kallithea/controllers/pullrequests.py	Tue Sep 06 00:51:18 2016 +0200
@@ -339,6 +339,10 @@
         (other_ref_type,
          other_ref_name,
          other_rev) = other_ref.split(':')
+        if other_ref_type == 'rev':
+            cs = other_repo.scm_instance.get_changeset(other_rev)
+            other_ref_name = cs.raw_id[:12]
+            other_ref = '%s:%s:%s' % (other_ref_type, other_ref_name, cs.raw_id)
 
         cs_ranges, _cs_ranges_not, ancestor_rev = \
             CompareController._get_changesets(org_repo.scm_instance.alias,