##// END OF EJS Templates
fixed issue with git's `no new line..` messages inside diff block. It might sometimes happen that showed html diff was short one line because of this
marcink -
r2360:c15c3430 beta
parent child Browse files
Show More
@@ -352,14 +352,24 b' class DiffProcessor(object):'
352 affects_old = affects_new = True
352 affects_old = affects_new = True
353 action = 'unmod'
353 action = 'unmod'
354
354
355 old_line += affects_old
355 if line.find('No newline at end of file') != -1:
356 new_line += affects_new
356 lines.append({
357 lines.append({
357 'old_lineno': '...',
358 'old_lineno': affects_old and old_line or '',
358 'new_lineno': '...',
359 'new_lineno': affects_new and new_line or '',
359 'action': 'context',
360 'action': action,
360 'line': line
361 'line': line
361 })
362 })
362
363 else:
364 old_line += affects_old
365 new_line += affects_new
366 lines.append({
367 'old_lineno': affects_old and old_line or '',
368 'new_lineno': affects_new and new_line or '',
369 'action': action,
370 'line': line
371 })
372
363 line = lineiter.next()
373 line = lineiter.next()
364
374
365 except StopIteration:
375 except StopIteration:
@@ -369,13 +379,12 b' class DiffProcessor(object):'
369 for _ in files:
379 for _ in files:
370 for chunk in chunks:
380 for chunk in chunks:
371 lineiter = iter(chunk)
381 lineiter = iter(chunk)
372 #first = True
373 try:
382 try:
374 while 1:
383 while 1:
375 line = lineiter.next()
384 line = lineiter.next()
376 if line['action'] != 'unmod':
385 if line['action'] != 'unmod':
377 nextline = lineiter.next()
386 nextline = lineiter.next()
378 if nextline['action'] == 'unmod' or \
387 if nextline['action'] in ['unmod', 'context'] or \
379 nextline['action'] == line['action']:
388 nextline['action'] == line['action']:
380 continue
389 continue
381 self.differ(line, nextline)
390 self.differ(line, nextline)
General Comments 0
You need to be logged in to leave comments. Login now