{% extends 'base.html' %} {% block extra_header %}{% endblock %} {# hide branch selector #} {% block title %} Commit {{ rev }} - {{ repo.name }} {% endblock %} {% block content %} {% set summary, file_changes = repo.commit_diff(commit) %}
{{ commit.message|force_unicode }} {% if commit.author != commit.committer %} {{ commit.author|force_unicode|extract_author_name }} authored {{ commit.author_time|timesince }} {{ commit.committer|force_unicode|extract_author_name }} committed {{ commit.commit_time|timesince }} {% else %} {{ commit.committer|force_unicode|extract_author_name }} {{ commit.commit_time|timesince }} {% endif %}
{{ summary.nfiles }} changed file(s) with {{ summary.nadditions }} addition(s) and {{ summary.ndeletions }} deletion(s). Raw diff Collapse all Expand all
{% for file in file_changes %}
{% set fileno = loop.index0 %}
{% if not file.get('is_binary') %}
+{{ file.additions }}
-{{ file.deletions }}
{% endif %} {# TODO dulwich doesn't do rename recognition {% if file.old_filename != file.new_filename %} {{ file.old_filename }} → {% endif %}#} {% if file.new_filename == '/dev/null' %} {{ file.old_filename|force_unicode }} {% else %} {{ file.new_filename|force_unicode }} {% endif %} less more
{% if file.get('is_binary') %}
Binary diff not shown
{% else %} {% for chunk in file.chunks %} {%- for line in chunk -%} {#- left column: linenos -#} {%- if line.old_lineno -%} {%- if line.new_lineno -%} {%- else -%} {%- endif -%} {%- else %} {%- if line.old_lineno -%} {%- else -%} {%- endif -%} {% endif %} {#- right column: code -#} {%- if line.old_lineno -%} {%- set line_id = "%s-L-%s"|format(fileno, line.old_lineno) -%} {%- else -%} {%- set line_id = "%s-R-%s"|format(fileno, line.new_lineno) -%} {%- endif -%} {%- endfor -%} {# lines #} {% if not loop.last %} {% endif %} {% else %} {% if file.old_filename == '/dev/null' %}
(New empty file)
{% elif file.new_filename == '/dev/null' %}
(Empty file)
{% else %} {# This case happens if a file has undergone only mode changes. In the future, if we have rename recognition, it may also happen if the file has been renamed without having its content changed. Currently, renames are always reported by dulwich as a file deletion and addition. #}
(No changes)
{% endif %} {%- endfor -%} {# chunks #}
{{ line.old_lineno }}{{ line.new_lineno }}{{ line.new_lineno }}{{ line.new_lineno }} {#- lineno anchors -#} {#- the actual line of code -#} {% autoescape false %}{{ line.line|force_unicode }}{% endautoescape %}{% if line.no_newline %}{% endif %}
{% endif %}
{% endfor %}
{% endblock %}