{% extends 'base.html' %} {% block extra_header %}{% endblock %} {# no branch selector on commits #} {% block title %} Commit {{ rev }} - {{ repo.name }} {% endblock %} {% block content %}
{# TODO code duplication in history.html #}
{{ commit.message|force_unicode }} {{ commit.author|force_unicode|extract_author_name }} {{ commit.commit_time|timesince }} ago
{% for file in repo.commit_diff(commit) %} {% set fileno = loop.index0 %}
{# 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 %}
{% if file.chunks %} {% 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 %} {%- 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 %}
{% else %}
Binary diff not shown
{% endif %} {% endfor %}
{% endblock %}