{% extends 'base.html' %} {% block extra_header %}{% endblock %} {# no branch selector on commits #} {% block title %} Commit {{ rev }} - {{ repo.name }} {% endblock %} {% block content %} {% set summary, file_changes = repo.commit_diff(commit) %}
{# TODO code duplication in history.html #}
{{ commit.message|force_unicode }} {{ commit.author|force_unicode|extract_author_name }} {{ commit.commit_time|timesince }}
{{ summary.nfiles }} changed file(s) with {{ summary.nadditions }} addition(s) and {{ summary.ndeletions }} deletion(s). 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 -#} {%- endfor -%} {# lines #} {% if not loop.last %} {% endif %} {% else %}
(No changes)
{%- endfor -%} {# chunks #}
{{ line.old_lineno }}{{ line.new_lineno }}{{ line.new_lineno }}{{ line.new_lineno }} {#- lineno anchors -#} {%- if line.old_lineno -%} {%- else -%} {%- endif -%} {#- the actual line of code -#} {% autoescape false %}{{ line.line|force_unicode }}{% endautoescape %}
{% endif %}
{% endfor %}
{% endblock %}