Changeset - 0edbffa9e2e2
[Not reviewed]
codereview
0 1 0
Marcin Kuzminski - 13 years ago 2012-05-28 00:09:39
marcin@python-works.com
fixed bug with inline changes highlighter.
1 file changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/diffs.py
Show inline comments
 
@@ -276,12 +276,13 @@ class DiffProcessor(object):
 
                    l['line'][:start],
 
                    tag,
 
                    l['line'][start:last],
 
                    tag,
 
                    l['line'][last:]
 
                )
 

	
 
            do(line)
 
            do(next_)
 

	
 
    def _parse_udiff(self):
 
        """
 
        Parse the diff an return data for the template.
 
@@ -374,14 +375,14 @@ class DiffProcessor(object):
 
                        })
 
                        line = lineiter.next()
 
        except StopIteration:
 
            pass
 

	
 
        # highlight inline changes
 
        for _ in files:
 
            for chunk in chunks:
 
        for diff_data in files:
 
            for chunk in diff_data['chunks']:
 
                lineiter = iter(chunk)
 
                try:
 
                    while 1:
 
                        line = lineiter.next()
 
                        if line['action'] != 'unmod':
 
                            nextline = lineiter.next()
 
@@ -431,13 +432,13 @@ class DiffProcessor(object):
 
        return u''.join(udiff_copy)
 

	
 
    def as_html(self, table_class='code-difftable', line_class='line',
 
                new_lineno_class='lineno old', old_lineno_class='lineno new',
 
                code_class='code', enable_comments=False, diff_lines=None):
 
        """
 
        Return udiff as html table with customized css classes
 
        Return given diff as html table with customized css classes
 
        """
 
        def _link_to_if(condition, label, url):
 
            """
 
            Generates a link if condition is meet or just the label if not.
 
            """
 

	
 
@@ -532,12 +533,14 @@ class DiffProcessor(object):
 
        """
 
        return self.adds, self.removes
 

	
 

	
 
def differ(org_repo, org_ref, other_repo, other_ref):
 
    """
 
    General differ between branches, bookmarks or separate but releated 
 
    repositories
 

	
 
    :param org_repo:
 
    :type org_repo:
 
    :param org_ref:
 
    :type org_ref:
 
    :param other_repo:
0 comments (0 inline, 0 general)