# HG changeset patch # User Marcin Kuzminski # Date 2017-03-28 20:37:33 # Node ID dcac0725c81a1e3eab137bad0850ddae3616763d # Parent 9d3367807ab625d4e67cb8d7378eacb46fba6f44 diffs: support mercurial copy in diffs details. diff --git a/rhodecode/public/css/code-block.less b/rhodecode/public/css/code-block.less --- a/rhodecode/public/css/code-block.less +++ b/rhodecode/public/css/code-block.less @@ -820,7 +820,6 @@ input.filediff-collapse-state { .pill { &[op="name"] { background: none; - color: @grey2; opacity: 1; color: white; } @@ -840,6 +839,10 @@ input.filediff-collapse-state { background: @color4; color: white; } + &[op="copied"] { + background: @color4; + color: white; + } &[op="mode"] { background: @grey3; color: white; diff --git a/rhodecode/templates/codeblocks/diffs.mako b/rhodecode/templates/codeblocks/diffs.mako --- a/rhodecode/templates/codeblocks/diffs.mako +++ b/rhodecode/templates/codeblocks/diffs.mako @@ -324,13 +324,17 @@ collapse_all = len(diffset.files) > coll <% stats = filediff['patch']['stats'] from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ - MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE + MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE %> %if filediff.source_file_path and filediff.target_file_path: %if filediff.source_file_path != filediff.target_file_path: - ## file was renamed - ${filediff.target_file_path}${filediff.source_file_path} + ## file was renamed, or copied + %if RENAMED_FILENODE in stats['ops']: + ${filediff.target_file_path}${filediff.source_file_path} + %elif COPIED_FILENODE in stats['ops']: + ${filediff.target_file_path} ⬅ ${filediff.source_file_path} + %endif %else: ## file was modified ${filediff.source_file_path} @@ -349,10 +353,15 @@ from rhodecode.lib.diffs import NEW_FILE %if filediff.patch['is_limited_diff']: limited diff %endif + %if RENAMED_FILENODE in stats['ops']: renamed %endif + %if COPIED_FILENODE in stats['ops']: + copied + %endif + %if NEW_FILENODE in stats['ops']: created %if filediff['target_mode'].startswith('120'):