Changeset - 4209cd4b7823
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-04-14 10:52:12
marcin@python-works.com
fixed problem with binary files, and for files that were deleted.
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changeset.py
Show inline comments
 
@@ -104,12 +104,14 @@ class ChangesetController(BaseRepoContro
 
                filenode_old = FileNode(node.path, '', EmptyChangeset())
 
                if filenode_old.is_binary or node.is_binary:
 
                    diff = wrap_to_table(_('binary file'))
 
                    st = (0, 0)
 
                else:
 
                    c.sum_added += node.size
 
                    if c.sum_added < self.cut_off_limit:
 
                        f_gitdiff = differ.get_gitdiff(filenode_old, node)
 
                        d = differ.DiffProcessor(f_gitdiff, format='gitdiff')
 
                        diff = d.as_html()
 
                        st = d.stat()
 
                    else:
 
                        diff = wrap_to_table(_('Changeset is to big and '
 
                                               'was cut off, see raw '
 
@@ -119,7 +121,6 @@ class ChangesetController(BaseRepoContro
 

	
 
                cs1 = None
 
                cs2 = node.last_changeset.raw_id
 
                st = d.stat()
 
                c.lines_added += st[0]
 
                c.lines_deleted += st[1]
 
                c.changes[changeset.raw_id].append(('added', node, diff,
 
@@ -138,6 +139,7 @@ class ChangesetController(BaseRepoContro
 

	
 
                    if filenode_old.is_binary or node.is_binary:
 
                        diff = wrap_to_table(_('binary file'))
 
                        st = (0, 0)
 
                    else:
 

	
 
                        if c.sum_removed < self.cut_off_limit:
 
@@ -145,7 +147,7 @@ class ChangesetController(BaseRepoContro
 
                            d = differ.DiffProcessor(f_gitdiff,
 
                                                     format='gitdiff')
 
                            diff = d.as_html()
 

	
 
                            st = d.stat()
 
                            if diff:
 
                                c.sum_removed += len(diff)
 
                        else:
 
@@ -157,7 +159,6 @@ class ChangesetController(BaseRepoContro
 

	
 
                    cs1 = filenode_old.last_changeset.raw_id
 
                    cs2 = node.last_changeset.raw_id
 
                    st = d.stat()
 
                    c.lines_added += st[0]
 
                    c.lines_deleted += st[1]
 
                    c.changes[changeset.raw_id].append(('changed', node, diff,
 
@@ -169,7 +170,7 @@ class ChangesetController(BaseRepoContro
 
            if not c.cut_off:
 
                for node in changeset.removed:
 
                    c.changes[changeset.raw_id].append(('removed', node, None,
 
                                                        None, None, None))
 
                                                        None, None, (0, 0)))
 

	
 
        if len(c.cs_ranges) == 1:
 
            c.changeset = c.cs_ranges[0]
rhodecode/lib/helpers.py
Show inline comments
 
@@ -644,7 +644,6 @@ def repo_link(groups_and_repos):
 

	
 
def fancy_file_stats(stats):
 
    a, d, t = stats[0], stats[1], stats[0] + stats[1]
 
    print stats
 
    width = 100
 
    unit = float(width) / (t or 1)
 

	
0 comments (0 inline, 0 general)