Changeset - b551f9c441dc
[Not reviewed]
default
0 2 0
Mads Kiilerich - 5 years ago 2020-10-29 15:12:56
mads@kiilerich.com
Grafted from: 9f4e4644a8a2
lib: minimize use of h.short_id() - it is already more common to use [:12]
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/model/comment.py
Show inline comments
 
@@ -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,
kallithea/model/pull_request.py
Show inline comments
 
@@ -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)
0 comments (0 inline, 0 general)