##// END OF EJS Templates
Alwas show initial context on html diffs.
marcink -
r2359:a264d898 beta
parent child Browse files
Show More
@@ -286,8 +286,6 b' class DiffProcessor(object):'
286 files = []
286 files = []
287 try:
287 try:
288 line = lineiter.next()
288 line = lineiter.next()
289 # skip first context
290 skipfirst = True
291 while 1:
289 while 1:
292 # continue until we found the old file
290 # continue until we found the old file
293 if not line.startswith('--- '):
291 if not line.startswith('--- '):
@@ -317,22 +315,23 b' class DiffProcessor(object):'
317 [int(x or 1) for x in match.groups()[:-1]]
315 [int(x or 1) for x in match.groups()[:-1]]
318 old_line -= 1
316 old_line -= 1
319 new_line -= 1
317 new_line -= 1
320 context = len(match.groups()) == 5
318 gr = match.groups()
319 context = len(gr) == 5
321 old_end += old_line
320 old_end += old_line
322 new_end += new_line
321 new_end += new_line
323
322
324 if context:
323 if context:
325 if not skipfirst:
324 # skip context only if it's first line
325 if int(gr[0]) > 1:
326 lines.append({
326 lines.append({
327 'old_lineno': '...',
327 'old_lineno': '...',
328 'new_lineno': '...',
328 'new_lineno': '...',
329 'action': 'context',
329 'action': 'context',
330 'line': line,
330 'line': line,
331 })
331 })
332 else:
333 skipfirst = False
334
332
335 line = lineiter.next()
333 line = lineiter.next()
334
336 while old_line < old_end or new_line < new_end:
335 while old_line < old_end or new_line < new_end:
337 if line:
336 if line:
338 command, line = line[0], line[1:]
337 command, line = line[0], line[1:]
General Comments 0
You need to be logged in to leave comments. Login now