Changeset - fbf75412c609
[Not reviewed]
default
0 5 0
Sean Farley - 11 years ago 2014-11-15 01:48:40
sean.michael.farley@gmail.com
diff: add op for renamed file
5 files changed with 26 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/diffs.py
Show inline comments
 
@@ -401,7 +401,7 @@ class DiffProcessor(object):
 
                # 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']))
kallithea/public/css/contextbar.css
Show inline comments
 
@@ -46,6 +46,12 @@ i[class^='icon-'] {
 
    color: #6cc644;
 
}
 

	
 
.icon-diff-R:before {
 
    font-family: 'kallithea';
 
    content: '\e81f';
 
    color: #677a85;
 
}
 

	
 
#content #context-bar {
 
    position: relative;
 
    overflow: visible;
kallithea/public/css/style.css
Show inline comments
 
@@ -2470,6 +2470,13 @@ BIN_FILENODE = 6
 
    text-align: left;
 
}
 

	
 
.cs_files .cs_renamed,
 
.cs_files .cs_R {
 
    height: 16px;
 
    margin-top: 7px;
 
    text-align: left;
 
}
 

	
 
.table {
 
    position: relative;
 
}
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -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
kallithea/tests/models/test_diff_parsers.py
Show inline comments
 
@@ -26,21 +26,19 @@ DIFF_FIXTURES = {
 
    ],
 

	
 
    '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 @@ DIFF_FIXTURES = {
 
          '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 @@ DIFF_FIXTURES = {
 
          '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,
0 comments (0 inline, 0 general)