Show More
@@ -104,12 +104,14 b' class ChangesetController(BaseRepoContro' | |||||
104 | filenode_old = FileNode(node.path, '', EmptyChangeset()) |
|
104 | filenode_old = FileNode(node.path, '', EmptyChangeset()) | |
105 | if filenode_old.is_binary or node.is_binary: |
|
105 | if filenode_old.is_binary or node.is_binary: | |
106 | diff = wrap_to_table(_('binary file')) |
|
106 | diff = wrap_to_table(_('binary file')) | |
|
107 | st = (0, 0) | |||
107 | else: |
|
108 | else: | |
108 | c.sum_added += node.size |
|
109 | c.sum_added += node.size | |
109 | if c.sum_added < self.cut_off_limit: |
|
110 | if c.sum_added < self.cut_off_limit: | |
110 | f_gitdiff = differ.get_gitdiff(filenode_old, node) |
|
111 | f_gitdiff = differ.get_gitdiff(filenode_old, node) | |
111 | d = differ.DiffProcessor(f_gitdiff, format='gitdiff') |
|
112 | d = differ.DiffProcessor(f_gitdiff, format='gitdiff') | |
112 | diff = d.as_html() |
|
113 | diff = d.as_html() | |
|
114 | st = d.stat() | |||
113 | else: |
|
115 | else: | |
114 | diff = wrap_to_table(_('Changeset is to big and ' |
|
116 | diff = wrap_to_table(_('Changeset is to big and ' | |
115 | 'was cut off, see raw ' |
|
117 | 'was cut off, see raw ' | |
@@ -119,7 +121,6 b' class ChangesetController(BaseRepoContro' | |||||
119 |
|
121 | |||
120 | cs1 = None |
|
122 | cs1 = None | |
121 | cs2 = node.last_changeset.raw_id |
|
123 | cs2 = node.last_changeset.raw_id | |
122 | st = d.stat() |
|
|||
123 | c.lines_added += st[0] |
|
124 | c.lines_added += st[0] | |
124 | c.lines_deleted += st[1] |
|
125 | c.lines_deleted += st[1] | |
125 | c.changes[changeset.raw_id].append(('added', node, diff, |
|
126 | c.changes[changeset.raw_id].append(('added', node, diff, | |
@@ -138,6 +139,7 b' class ChangesetController(BaseRepoContro' | |||||
138 |
|
139 | |||
139 | if filenode_old.is_binary or node.is_binary: |
|
140 | if filenode_old.is_binary or node.is_binary: | |
140 | diff = wrap_to_table(_('binary file')) |
|
141 | diff = wrap_to_table(_('binary file')) | |
|
142 | st = (0, 0) | |||
141 | else: |
|
143 | else: | |
142 |
|
144 | |||
143 | if c.sum_removed < self.cut_off_limit: |
|
145 | if c.sum_removed < self.cut_off_limit: | |
@@ -145,7 +147,7 b' class ChangesetController(BaseRepoContro' | |||||
145 | d = differ.DiffProcessor(f_gitdiff, |
|
147 | d = differ.DiffProcessor(f_gitdiff, | |
146 | format='gitdiff') |
|
148 | format='gitdiff') | |
147 | diff = d.as_html() |
|
149 | diff = d.as_html() | |
148 |
|
150 | st = d.stat() | ||
149 | if diff: |
|
151 | if diff: | |
150 | c.sum_removed += len(diff) |
|
152 | c.sum_removed += len(diff) | |
151 | else: |
|
153 | else: | |
@@ -157,7 +159,6 b' class ChangesetController(BaseRepoContro' | |||||
157 |
|
159 | |||
158 | cs1 = filenode_old.last_changeset.raw_id |
|
160 | cs1 = filenode_old.last_changeset.raw_id | |
159 | cs2 = node.last_changeset.raw_id |
|
161 | cs2 = node.last_changeset.raw_id | |
160 | st = d.stat() |
|
|||
161 | c.lines_added += st[0] |
|
162 | c.lines_added += st[0] | |
162 | c.lines_deleted += st[1] |
|
163 | c.lines_deleted += st[1] | |
163 | c.changes[changeset.raw_id].append(('changed', node, diff, |
|
164 | c.changes[changeset.raw_id].append(('changed', node, diff, | |
@@ -169,7 +170,7 b' class ChangesetController(BaseRepoContro' | |||||
169 | if not c.cut_off: |
|
170 | if not c.cut_off: | |
170 | for node in changeset.removed: |
|
171 | for node in changeset.removed: | |
171 | c.changes[changeset.raw_id].append(('removed', node, None, |
|
172 | c.changes[changeset.raw_id].append(('removed', node, None, | |
172 |
None, None, |
|
173 | None, None, (0, 0))) | |
173 |
|
174 | |||
174 | if len(c.cs_ranges) == 1: |
|
175 | if len(c.cs_ranges) == 1: | |
175 | c.changeset = c.cs_ranges[0] |
|
176 | c.changeset = c.cs_ranges[0] |
@@ -644,7 +644,6 b' def repo_link(groups_and_repos):' | |||||
644 |
|
644 | |||
645 | def fancy_file_stats(stats): |
|
645 | def fancy_file_stats(stats): | |
646 | a, d, t = stats[0], stats[1], stats[0] + stats[1] |
|
646 | a, d, t = stats[0], stats[1], stats[0] + stats[1] | |
647 | print stats |
|
|||
648 | width = 100 |
|
647 | width = 100 | |
649 | unit = float(width) / (t or 1) |
|
648 | unit = float(width) / (t or 1) | |
650 |
|
649 |
General Comments 0
You need to be logged in to leave comments.
Login now