changeset 8717:b551f9c441dc

lib: minimize use of h.short_id() - it is already more common to use [:12]
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 29 Oct 2020 15:12:56 +0100
parents 95082c4dffe7
children f8b092f9e6a3
files kallithea/model/comment.py kallithea/model/pull_request.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/comment.py	Thu Oct 29 15:12:56 2020 +0100
+++ b/kallithea/model/comment.py	Thu Oct 29 15:12:56 2020 +0100
@@ -106,7 +106,7 @@
                 'cs_author': cs_author,
                 'cs_author_username': cs_author.username,
                 'repo_name': repo.repo_name,
-                'short_id': h.short_id(revision),
+                'short_id': revision[:12],
                 'branch': cs.branch,
                 'comment_username': author.username,
                 'threading': threading,
--- a/kallithea/model/pull_request.py	Thu Oct 29 15:12:56 2020 +0100
+++ b/kallithea/model/pull_request.py	Thu Oct 29 15:12:56 2020 +0100
@@ -350,21 +350,21 @@
             for r in old_pull_request.revisions:
                 if r in lost:
                     rev_desc = org_repo.get_changeset(r).message.split('\n')[0]
-                    infos.append('  %s %s' % (h.short_id(r), rev_desc))
+                    infos.append('  %s %s' % (r[:12], rev_desc))
 
         if new_revisions:
             infos.append(_('New changesets on %s %s since the previous iteration:') % (org_ref_type, org_ref_name))
             for r in reversed(revisions):
                 if r in new_revisions:
                     rev_desc = org_repo.get_changeset(r).message.split('\n')[0]
-                    infos.append('  %s %s' % (h.short_id(r), h.shorter(rev_desc, 80)))
+                    infos.append('  %s %s' % (r[:12], h.shorter(rev_desc, 80)))
 
             if self.create_action.other_ref == old_pull_request.other_ref:
                 infos.append(_("Ancestor didn't change - diff since previous iteration:"))
                 infos.append(h.canonical_url('compare_url',
                                  repo_name=org_repo.repo_name, # other_repo is always same as repo_name
-                                 org_ref_type='rev', org_ref_name=h.short_id(org_rev), # use old org_rev as base
-                                 other_ref_type='rev', other_ref_name=h.short_id(new_org_rev),
+                                 org_ref_type='rev', org_ref_name=org_rev[:12], # use old org_rev as base
+                                 other_ref_type='rev', other_ref_name=new_org_rev[:12],
                                  )) # note: linear diff, merge or not doesn't matter
             else:
                 infos.append(_('This iteration is based on another %s revision and there is no simple diff.') % other_ref_name)