diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -296,7 +296,7 @@ class ChangesetController(BaseRepoContro url_fid = h.FID('', filename) diff = diff_processor.as_html(enable_comments=enable_comments, parsed_lines=[f]) - file_diff_data[fid] = (url_fid, f['operation'], filename, diff, st) + file_diff_data[fid] = (url_fid, f['operation'], f['old_filename'], filename, diff, st) else: # downloads/raw we only need RAW diff nothing else diff = diff_processor.as_raw() diff --git a/kallithea/controllers/compare.py b/kallithea/controllers/compare.py --- a/kallithea/controllers/compare.py +++ b/kallithea/controllers/compare.py @@ -288,6 +288,6 @@ class CompareController(BaseRepoControll fid = h.FID('', filename) diff = diff_processor.as_html(enable_comments=False, parsed_lines=[f]) - c.file_diff_data[fid] = (None, f['operation'], filename, diff, st) + c.file_diff_data[fid] = (None, f['operation'], f['old_filename'], filename, diff, st) return render('compare/compare_diff.html') diff --git a/kallithea/controllers/files.py b/kallithea/controllers/files.py --- a/kallithea/controllers/files.py +++ b/kallithea/controllers/files.py @@ -683,13 +683,13 @@ class FilesController(BaseRepoController ign_whitespace_lcl = get_ignore_ws(fid, request.GET) lim = request.GET.get('fulldiff') or self.cut_off_limit - c.a_rev, c.cs_rev, op, diff, st = diffs.wrapped_diff(filenode_old=node1, + c.a_rev, c.cs_rev, a_path, diff, st, op = diffs.wrapped_diff(filenode_old=node1, filenode_new=node2, cut_off_limit=lim, ignore_whitespace=ign_whitespace_lcl, line_context=line_context_lcl, enable_comments=False) - c.file_diff_data = {fid: (fid, op, node1.path, diff, st)} + c.file_diff_data = {fid: (fid, op, a_path, node2.path, diff, st)} return render('files/file_diff.html') diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -707,7 +707,7 @@ class PullrequestsController(BaseRepoCon fid = h.FID('', filename) diff = diff_processor.as_html(enable_comments=True, parsed_lines=[f]) - c.file_diff_data[fid] = (None, f['operation'], filename, diff, st) + c.file_diff_data[fid] = (None, f['operation'], f['old_filename'], filename, diff, st) # inline comments c.inline_cnt = 0 diff --git a/kallithea/lib/diffs.py b/kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py +++ b/kallithea/lib/diffs.py @@ -63,6 +63,7 @@ def wrapped_diff(filenode_old, filenode_ filenode_old = FileNode(filenode_new.path, '', EmptyChangeset()) op = None + a_path = filenode_old.path # default, might be overriden by actual rename in diff if filenode_old.is_binary or filenode_new.is_binary: diff = wrap_to_table(_('Binary file')) stats = (0, 0) @@ -79,6 +80,7 @@ def wrapped_diff(filenode_old, filenode_ if _parsed: # there should be exactly one element, for the specified file f = _parsed[0] op = f['operation'] + a_path = f['old_filename'] diff = diff_processor.as_html(enable_comments=enable_comments) stats = diff_processor.stat() @@ -99,7 +101,7 @@ def wrapped_diff(filenode_old, filenode_ cs1 = filenode_old.changeset.raw_id cs2 = filenode_new.changeset.raw_id - return cs1, cs2, op, diff, stats + return cs1, cs2, a_path, diff, stats, op def get_gitdiff(filenode_old, filenode_new, ignore_whitespace=True, context=3): @@ -476,6 +478,7 @@ class DiffProcessor(object): if _op not in [MOD_FILENODE]]) _files.append({ + 'old_filename': head['a_path'], 'filename': head['b_path'], 'old_revision': head['a_blob_id'], 'new_revision': head['b_blob_id'], 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 @@ -168,7 +168,7 @@ ${self.repo_context_bar('changelog', c.c %endif