Changeset - 7d5e50517430
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2021-02-18 12:23:19
mads@kiilerich.com
diffs: change name of high level function name for generating HTML diff to html_diff
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/files.py
Show inline comments
 
@@ -636,13 +636,13 @@ class FilesController(base.BaseRepoContr
 
            response.content_type = 'text/plain'
 
            return raw_diff
 

	
 
        else:
 
            fid = h.FID(diff2, node2.path)
 
            diff_limit = None if fulldiff else self.cut_off_limit
 
            c.a_rev, c.cs_rev, a_path, diff, st, op = diffs.wrapped_diff(filenode_old=node1,
 
            c.a_rev, c.cs_rev, a_path, diff, st, op = diffs.html_diff(filenode_old=node1,
 
                                         filenode_new=node2,
 
                                         diff_limit=diff_limit,
 
                                         ignore_whitespace=ignore_whitespace_diff,
 
                                         line_context=diff_context_size)
 
            c.file_diff_data = [(fid, fid, op, a_path, node2.path, diff, st)]
 
            return base.render('files/file_diff.html')
kallithea/lib/diffs.py
Show inline comments
 
@@ -165,16 +165,16 @@ def wrap_to_table(html):
 
                <td class="lineno new"></td>
 
                <td class="code"><pre>%s</pre></td>
 
                </tr>
 
              </table>''' % html
 

	
 

	
 
def wrapped_diff(filenode_old, filenode_new, diff_limit=None,
 
def html_diff(filenode_old, filenode_new, diff_limit=None,
 
                ignore_whitespace=True, line_context=3):
 
    """
 
    Returns a file diff wrapped into a table.
 
    Returns a file diff as HTML wrapped into a table.
 
    Checks for diff_limit and presents a message if the diff is too big.
 
    """
 
    if filenode_old is None:
 
        filenode_old = FileNode(filenode_new.path, '', EmptyChangeset())
 

	
 
    op = None
0 comments (0 inline, 0 general)