diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py
--- a/kallithea/controllers/changeset.py
+++ b/kallithea/controllers/changeset.py
@@ -25,6 +25,7 @@ Original author and date, and relevant c
:license: GPLv3, see LICENSE.md for more details.
"""
+import binascii
import logging
import traceback
from collections import OrderedDict, defaultdict
@@ -395,6 +396,8 @@ class ChangesetController(BaseRepoContro
c.changeset = c.cs_ranges[0]
c.parent_tmpl = ''.join(['# Parent %s\n' % x.raw_id
for x in c.changeset.parents])
+ c.changeset_graft_source_hash = c.changeset.extra.get(b'source', b'')
+ c.changeset_transplant_source_hash = binascii.hexlify(c.changeset.extra.get(b'transplant_source', b''))
if method == 'download':
response.content_type = 'text/plain'
response.content_disposition = 'attachment; filename=%s.diff' \
diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html
--- a/kallithea/templates/changeset/changeset.html
+++ b/kallithea/templates/changeset/changeset.html
@@ -90,16 +90,14 @@ ${self.repo_context_bar('changelog', c.c
${h.person(c.changeset.author,'full_name_and_username')} - ${h.age(c.changeset.date,True)} ${h.fmt_date(c.changeset.date)}
${h.email_or_none(c.changeset.author)}
- <% rev = c.changeset.extra.get('source') %>
- %if rev:
+ %if c.changeset_graft_source_hash: