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