diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -1549,99 +1549,6 @@ def format_byte_size_binary(file_size): return formatted_size -def fancy_file_stats(stats): - """ - Displays a fancy two colored bar for number of added/deleted - lines of code on file - - :param stats: two element list of added/deleted lines of code - """ - from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ - MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE - - def cgen(l_type, a_v, d_v): - mapping = {'tr': 'top-right-rounded-corner-mid', - 'tl': 'top-left-rounded-corner-mid', - 'br': 'bottom-right-rounded-corner-mid', - 'bl': 'bottom-left-rounded-corner-mid'} - map_getter = lambda x: mapping[x] - - if l_type == 'a' and d_v: - #case when added and deleted are present - return ' '.join(map(map_getter, ['tl', 'bl'])) - - if l_type == 'a' and not d_v: - return ' '.join(map(map_getter, ['tr', 'br', 'tl', 'bl'])) - - if l_type == 'd' and a_v: - return ' '.join(map(map_getter, ['tr', 'br'])) - - if l_type == 'd' and not a_v: - return ' '.join(map(map_getter, ['tr', 'br', 'tl', 'bl'])) - - a, d = stats['added'], stats['deleted'] - width = 100 - - if stats['binary']: # binary operations like chmod/rename etc - lbl = [] - bin_op = 0 # undefined - - # prefix with bin for binary files - if BIN_FILENODE in stats['ops']: - lbl += ['bin'] - - if NEW_FILENODE in stats['ops']: - lbl += [_('new file')] - bin_op = NEW_FILENODE - elif MOD_FILENODE in stats['ops']: - lbl += [_('mod')] - bin_op = MOD_FILENODE - elif DEL_FILENODE in stats['ops']: - lbl += [_('del')] - bin_op = DEL_FILENODE - elif RENAMED_FILENODE in stats['ops']: - lbl += [_('rename')] - bin_op = RENAMED_FILENODE - - # chmod can go with other operations, so we add a + to lbl if needed - if CHMOD_FILENODE in stats['ops']: - lbl += [_('chmod')] - if bin_op == 0: - bin_op = CHMOD_FILENODE - - lbl = '+'.join(lbl) - b_a = '