##// END OF EJS Templates
fixed raw_changeset for git, accidentally it was generated with hg patch headers...
marcink -
r2083:60115135 beta
parent child Browse files
Show More
@@ -221,17 +221,20 b' class ChangesetController(BaseRepoContro'
221 lim = self.cut_off_limit
221 lim = self.cut_off_limit
222 if cumulative_diff > self.cut_off_limit:
222 if cumulative_diff > self.cut_off_limit:
223 lim = -1
223 lim = -1
224 size, cs1, cs2, diff, st = wrapped_diff(filenode_old=None,
224 size, cs1, cs2, diff, st = wrapped_diff(
225 filenode_new=node,
225 filenode_old=None,
226 cut_off_limit=lim,
226 filenode_new=node,
227 ignore_whitespace=ign_whitespace_lcl,
227 cut_off_limit=lim,
228 line_context=line_context_lcl,
228 ignore_whitespace=ign_whitespace_lcl,
229 enable_comments=enable_comments)
229 line_context=line_context_lcl,
230 enable_comments=enable_comments
231 )
230 cumulative_diff += size
232 cumulative_diff += size
231 c.lines_added += st[0]
233 c.lines_added += st[0]
232 c.lines_deleted += st[1]
234 c.lines_deleted += st[1]
233 c.changes[changeset.raw_id].append(('added', node, diff,
235 c.changes[changeset.raw_id].append(
234 cs1, cs2, st))
236 ('added', node, diff, cs1, cs2, st)
237 )
235
238
236 #==================================================================
239 #==================================================================
237 # CHANGED FILES
240 # CHANGED FILES
@@ -249,24 +252,27 b' class ChangesetController(BaseRepoContro'
249 lim = self.cut_off_limit
252 lim = self.cut_off_limit
250 if cumulative_diff > self.cut_off_limit:
253 if cumulative_diff > self.cut_off_limit:
251 lim = -1
254 lim = -1
252 size, cs1, cs2, diff, st = wrapped_diff(filenode_old=filenode_old,
255 size, cs1, cs2, diff, st = wrapped_diff(
253 filenode_new=node,
256 filenode_old=filenode_old,
254 cut_off_limit=lim,
257 filenode_new=node,
255 ignore_whitespace=ign_whitespace_lcl,
258 cut_off_limit=lim,
256 line_context=line_context_lcl,
259 ignore_whitespace=ign_whitespace_lcl,
257 enable_comments=enable_comments)
260 line_context=line_context_lcl,
261 enable_comments=enable_comments
262 )
258 cumulative_diff += size
263 cumulative_diff += size
259 c.lines_added += st[0]
264 c.lines_added += st[0]
260 c.lines_deleted += st[1]
265 c.lines_deleted += st[1]
261 c.changes[changeset.raw_id].append(('changed', node, diff,
266 c.changes[changeset.raw_id].append(
262 cs1, cs2, st))
267 ('changed', node, diff, cs1, cs2, st)
263
268 )
264 #==================================================================
269 #==================================================================
265 # REMOVED FILES
270 # REMOVED FILES
266 #==================================================================
271 #==================================================================
267 for node in changeset.removed:
272 for node in changeset.removed:
268 c.changes[changeset.raw_id].append(('removed', node, None,
273 c.changes[changeset.raw_id].append(
269 None, None, (0, 0)))
274 ('removed', node, None, None, None, (0, 0))
275 )
270
276
271 # count inline comments
277 # count inline comments
272 for path, lines in c.inline_comments:
278 for path, lines in c.inline_comments:
@@ -335,8 +341,8 b' class ChangesetController(BaseRepoContro'
335 response.content_disposition = 'attachment; filename=%s.patch' \
341 response.content_disposition = 'attachment; filename=%s.patch' \
336 % revision
342 % revision
337
343
338 c.parent_tmpl = ''.join(['# Parent %s\n' % x.raw_id for x in
344 c.parent_tmpl = ''.join(['# Parent %s\n' % x.raw_id
339 c.changeset.parents])
345 for x in c.changeset.parents])
340
346
341 c.diffs = ''
347 c.diffs = ''
342 for x in c.changes:
348 for x in c.changes:
@@ -428,8 +428,9 b' class FilesController(BaseRepoController'
428
428
429 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
429 diff_name = '%s_vs_%s.diff' % (diff1, diff2)
430 response.content_type = 'text/plain'
430 response.content_type = 'text/plain'
431 response.content_disposition = 'attachment; filename=%s' \
431 response.content_disposition = (
432 % diff_name
432 'attachment; filename=%s' % diff_name
433 )
433 return diff.raw_diff()
434 return diff.raw_diff()
434
435
435 elif c.action == 'raw':
436 elif c.action == 'raw':
@@ -1,8 +1,9 b''
1 %if h.is_hg(c.scm_type):
1 # ${c.scm_type.upper()} changeset patch
2 # ${c.scm_type.upper()} changeset patch
2 # User ${c.changeset.author|n}
3 # User ${c.changeset.author|n}
3 # Date ${c.changeset.date}
4 # Date ${c.changeset.date}
4 # Node ID ${c.changeset.raw_id}
5 # Node ID ${c.changeset.raw_id}
5 ${c.parent_tmpl}
6 ${c.parent_tmpl}
6 ${c.changeset.message}
7 ${c.changeset.message}
7
8 %endif
8 ${c.diffs|n}
9 ${c.diffs|n}
General Comments 0
You need to be logged in to leave comments. Login now