changeset 8716:95082c4dffe7

lib: use x.short_id instead of h.short_id(x.raw_id)
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 29 Oct 2020 15:12:56 +0100
parents b095a92a4312
children b551f9c441dc
files kallithea/controllers/files.py kallithea/controllers/pullrequests.py kallithea/templates/changelog/changelog.html kallithea/templates/changeset/changeset_range.html kallithea/templates/pullrequests/pullrequest_show.html
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/files.py	Thu Oct 29 11:38:10 2020 +0100
+++ b/kallithea/controllers/files.py	Thu Oct 29 15:12:56 2020 +0100
@@ -183,7 +183,7 @@
 
         # TODO: tags and bookmarks?
         c.revision_options = [(c.changeset.raw_id,
-                              _('%s at %s') % (b, h.short_id(c.changeset.raw_id))) for b in c.changeset.branches] + \
+                              _('%s at %s') % (b, c.changeset.short_id)) for b in c.changeset.branches] + \
             [(n, b) for b, n in c.db_repo_scm_instance.branches.items()]
         if c.db_repo_scm_instance.closed_branches:
             prefix = _('(closed)') + ' '
--- a/kallithea/controllers/pullrequests.py	Thu Oct 29 11:38:10 2020 +0100
+++ b/kallithea/controllers/pullrequests.py	Thu Oct 29 15:12:56 2020 +0100
@@ -552,7 +552,7 @@
                         show.update(org_scm_instance._repo.revs('::%ld - ::%ld - ::%s', brevs, avail_revs, c.a_branch_name))
                         show.add(revs[0]) # make sure graph shows this so we can see how they relate
                         c.update_msg_other = _('Note: Branch %s has another head: %s.') % (c.cs_branch_name,
-                            h.short_id(org_scm_instance.get_changeset((max(brevs))).raw_id))
+                            org_scm_instance.get_changeset(max(brevs)).short_id)
 
                     avail_show = sorted(show, reverse=True)
 
--- a/kallithea/templates/changelog/changelog.html	Thu Oct 29 11:38:10 2020 +0100
+++ b/kallithea/templates/changelog/changelog.html	Thu Oct 29 15:12:56 2020 +0100
@@ -18,7 +18,7 @@
      - /${c.changelog_for_path}
     %endif
     %if c.revision:
-    @ ${h.short_id(c.first_revision.raw_id)}
+    @ ${c.first_revision.short_id}
     %endif
     - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
 </%def>
--- a/kallithea/templates/changeset/changeset_range.html	Thu Oct 29 11:38:10 2020 +0100
+++ b/kallithea/templates/changeset/changeset_range.html	Thu Oct 29 15:12:56 2020 +0100
@@ -35,7 +35,7 @@
                     %if c.visual.use_gravatar:
                     <td>${h.gravatar_div(h.email_or_none(cs.author), size=14)}</td>
                     %endif
-                    <td>${h.link_to(h.short_id(cs.raw_id),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td>
+                    <td>${h.link_to(cs.short_id,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td>
                     <td class="author">${h.person(cs.author)}</td>
                     <td><span data-toggle="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
                     <td>
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Thu Oct 29 11:38:10 2020 +0100
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Thu Oct 29 15:12:56 2020 +0100
@@ -106,7 +106,7 @@
               <div>
                ## TODO: use cs_ranges[-1] or org_ref_parts[1] in both cases?
                %if h.is_hg(c.pull_request.org_repo):
-                 <span>hg pull ${c.pull_request.org_repo.clone_url(clone_uri_tmpl=c.clone_uri_tmpl)} -r ${h.short_id(c.cs_ranges[-1].raw_id)}</span>
+                 <span>hg pull ${c.pull_request.org_repo.clone_url(clone_uri_tmpl=c.clone_uri_tmpl)} -r ${c.cs_ranges[-1].short_id}</span>
                %elif h.is_git(c.pull_request.org_repo):
                  <span>git pull ${c.pull_request.org_repo.clone_url(clone_uri_tmpl=c.clone_uri_tmpl)} ${c.pull_request.org_ref_parts[1]}</span>
                %endif