Mercurial > kallithea
changeset 4634:fbf75412c609
diff: add op for renamed file
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Fri, 14 Nov 2014 16:48:40 -0800 |
parents | dbf7341d10b1 |
children | 80faf3ee3e92 |
files | kallithea/lib/diffs.py kallithea/public/css/contextbar.css kallithea/public/css/style.css kallithea/templates/changeset/diff_block.html kallithea/tests/models/test_diff_parsers.py |
diffstat | 5 files changed, 26 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/diffs.py Sat Nov 15 11:21:48 2014 -0800 +++ b/kallithea/lib/diffs.py Fri Nov 14 16:48:40 2014 -0800 @@ -401,7 +401,7 @@ # RENAME if (head['rename_from'] and head['rename_to'] and head['rename_from'] != head['rename_to']): - op = 'M' + op = 'R' stats['binary'] = True stats['ops'][RENAMED_FILENODE] = ('file renamed from %s to %s' % (head['rename_from'], head['rename_to']))
--- a/kallithea/public/css/contextbar.css Sat Nov 15 11:21:48 2014 -0800 +++ b/kallithea/public/css/contextbar.css Fri Nov 14 16:48:40 2014 -0800 @@ -46,6 +46,12 @@ color: #6cc644; } +.icon-diff-R:before { + font-family: 'kallithea'; + content: '\e81f'; + color: #677a85; +} + #content #context-bar { position: relative; overflow: visible;
--- a/kallithea/public/css/style.css Sat Nov 15 11:21:48 2014 -0800 +++ b/kallithea/public/css/style.css Fri Nov 14 16:48:40 2014 -0800 @@ -2470,6 +2470,13 @@ text-align: left; } +.cs_files .cs_renamed, +.cs_files .cs_R { + height: 16px; + margin-top: 7px; + text-align: left; +} + .table { position: relative; }
--- a/kallithea/templates/changeset/diff_block.html Sat Nov 15 11:21:48 2014 -0800 +++ b/kallithea/templates/changeset/diff_block.html Fri Nov 14 16:48:40 2014 -0800 @@ -86,6 +86,11 @@ %elif op == 'D': ${_('Deleted')} <a class="spantag" href="${h.url('files_home', repo_name=c.a_repo.repo_name, f_path=filenode_path, revision=c.a_rev)}">${h.short_id(c.a_ref_name) if c.a_ref_type=='rev' else c.a_ref_name}</a> + %elif op == 'R': + ${_('Renamed')} + <a class="spantag" href="${h.url('files_home', repo_name=c.a_repo.repo_name, f_path=filenode_path, revision=c.a_rev)}">${h.short_id(c.a_ref_name) if c.a_ref_type=='rev' else c.a_ref_name}</a> + <i class="icon-arrow-right"></i> + <a class="spantag" href="${h.url('files_home', repo_name=c.cs_repo.repo_name, f_path=filenode_path, revision=c.cs_rev)}">${h.short_id(c.cs_ref_name) if c.cs_ref_type=='rev' else c.cs_ref_name}</a> %else: ${op}??? %endif
--- a/kallithea/tests/models/test_diff_parsers.py Sat Nov 15 11:21:48 2014 -0800 +++ b/kallithea/tests/models/test_diff_parsers.py Fri Nov 14 16:48:40 2014 -0800 @@ -26,21 +26,19 @@ ], 'hg_diff_mod_single_file_and_rename_and_chmod.diff': [ - ('README', 'M', + ('README', 'R', {'added': 3, 'deleted': 0, 'binary': False, - 'ops': {MOD_FILENODE: 'modified file', - RENAMED_FILENODE: 'file renamed from README.rst to README', + 'ops': {RENAMED_FILENODE: 'file renamed from README.rst to README', CHMOD_FILENODE: 'modified file chmod 100755 => 100644'}}), ], 'hg_diff_mod_file_and_rename.diff': [ - ('README.rst', 'M', + ('README.rst', 'R', {'added': 3, 'deleted': 0, 'binary': False, - 'ops': {MOD_FILENODE: 'modified file', - RENAMED_FILENODE: 'file renamed from README to README.rst'}}), + 'ops': {RENAMED_FILENODE: 'file renamed from README to README.rst'}}), ], 'hg_diff_del_single_binary_file.diff': [ ('US Warszawa.jpg', 'D', @@ -66,14 +64,14 @@ 'ops': {CHMOD_FILENODE: 'modified file chmod 100755 => 100644'}}), ], 'hg_diff_rename_file.diff': [ - ('file_renamed', 'M', + ('file_renamed', 'R', {'added': 0, 'deleted': 0, 'binary': True, 'ops': {RENAMED_FILENODE: 'file renamed from file to file_renamed'}}), ], 'hg_diff_rename_and_chmod_file.diff': [ - ('README', 'M', + ('README', 'R', {'added': 0, 'deleted': 0, 'binary': True, @@ -132,7 +130,7 @@ 'ops': {CHMOD_FILENODE: 'modified file chmod 100644 => 100755'}}) ], 'git_diff_rename_file.diff': [ - ('file.xls', 'M', + ('file.xls', 'R', {'added': 0, 'deleted': 0, 'binary': True,