# HG changeset patch # User Mads Kiilerich # Date 2020-10-29 15:12:56 # Node ID b551f9c441dc3da35ab59070b0359562566367d0 # Parent 95082c4dffe7183a5fa0ffbf8360ca9c3d2650fd lib: minimize use of h.short_id() - it is already more common to use [:12] diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -106,7 +106,7 @@ class ChangesetCommentsModel(object): '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, diff --git a/kallithea/model/pull_request.py b/kallithea/model/pull_request.py --- a/kallithea/model/pull_request.py +++ b/kallithea/model/pull_request.py @@ -350,21 +350,21 @@ class CreatePullRequestIterationAction(o 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)