Changeset - a264d898ca08
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-05-30 20:46:37
marcin@python-works.com
Alwas show initial context on html diffs.
1 file changed with 5 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/diffs.py
Show inline comments
 
@@ -286,8 +286,6 @@ class DiffProcessor(object):
 
        files = []
 
        try:
 
            line = lineiter.next()
 
            # skip first context
 
            skipfirst = True
 
            while 1:
 
                # continue until we found the old file
 
                if not line.startswith('--- '):
 
@@ -317,22 +315,23 @@ class DiffProcessor(object):
 
                        [int(x or 1) for x in match.groups()[:-1]]
 
                    old_line -= 1
 
                    new_line -= 1
 
                    context = len(match.groups()) == 5
 
                    gr = match.groups()
 
                    context = len(gr) == 5
 
                    old_end += old_line
 
                    new_end += new_line
 

	
 
                    if context:
 
                        if not skipfirst:
 
                        # skip context only if it's first line
 
                        if int(gr[0]) > 1:
 
                            lines.append({
 
                                'old_lineno': '...',
 
                                'new_lineno': '...',
 
                                'action':     'context',
 
                                'line':       line,
 
                            })
 
                        else:
 
                            skipfirst = False
 

	
 
                    line = lineiter.next()
 

	
 
                    while old_line < old_end or new_line < new_end:
 
                        if line:
 
                            command, line = line[0], line[1:]
0 comments (0 inline, 0 general)