Blob Blame Raw
{% extends "repo_master.html" %}

{% block title %}Commit - {{ repo.name }} - {{ commitid }}{% endblock %}
{%block tag %}commit{% endblock %}

{% block repo %}

{% set splitted_message = commit.message.split('\n') %}
<div class="header">
<h3>
    {{ splitted_message[0] }}
    (<span class="commitid" title="{{ commitid }}">commit: {{ commitid|short }}
    </span> - <a href="{{ url_for('view_tree', username=username,
        repo=repo.name, identifier=commitid) }}">tree</a>)
    {% if splitted_message|length > 1 %}
    <span class="commit_message_body">
        {% for message in splitted_message %}
            {% if loop.index > 1 %}
                {{ message }}
            {% endif %}
        {% endfor %}
    </span>
    {% endif %}
</h3>

<ul class="buttons">
    <li><a class="button raw" href="{{ url_for('view_raw_file', username=username,
            repo=repo.name, identifier=commitid) }}" title="View as raw">Raw</a></li>
    <li>
        <a class="button patch" href="{{ url_for('view_commit_patch', username=username,
            repo=repo.name, commitid=commitid) }}">Patch</a>
    </li>
</ul>

</div>
<table>
  <tr>
    <th>Author</th>
    <td>
      {{ commit.author.name }} {{ '<' + commit.author.email + '>' }}
      - {{ commit.commit_time | format_ts}}
    </td>
  </tr>
  <tr>
    <th>Committer</th>
    <td>
      {{ commit.committer.name }} {{ '<' + commit.committer.email + '>' }}
      - {{ commit.commit_time | format_ts }}
    </td>
  </tr>
  <tr>
    <th>Parent</th>
    <td>
      {% for parent in commit.parents %}
        <a href="{{ url_for('view_commit', username=username,
                  repo=repo.name, commitid=parent.oid.hex) }}">
          {{ parent.oid.hex }}
        </a> <br />
      {% endfor %}
    </td>
  </tr>
  <tr>
      <th>Changes</th>
      <td>
        <ul class="changes">
        {% for patch in diff %}
          <li>
            <span class="addrem_bar">
              {% if not patch.is_binary and (patch.additions + patch.deletions) > 0%}
              <span style="width: {{ (100.0 * patch.additions / (patch.additions + patch.deletions))|round|int }}%">
                    {% if patch.additions > 0 %}+{{ patch.additions }}{% endif %}
                    {% if patch.deletions > 0 %}-{{ patch.deletions }}{% endif %}
              </span>
              {% endif %}
            </span>
            {{ patch.new_file_path }}
          </li>
        {% endfor %}
        </ul>
      </td>
  </tr>
</table>

{% for patch in diff %}
<section class="commit_diff">
    <header>
        <h3>{{  patch.new_file_path }}</h3>
        <ul class="buttons">
            <li class="addrem_bar">
            {% if not patch.is_binary and (patch.additions + patch.deletions) > 0%}
            <span style="width: {{ (100.0 * patch.additions / (patch.additions + patch.deletions))|round|int }}%">
                {% if patch.additions > 0 %}+{{ patch.additions }}{% endif %}
                {% if patch.deletions > 0 %}-{{ patch.deletions }}{% endif %}
            </span>
            {% endif %}
            </li>
            <li>
                <a class="button view" href="{{ url_for('view_file', username=username,
                    repo=repo.name, identifier=commitid,
                    filename=patch.new_file_path) }}" title="View file as of {{ commitid|short }}">View</a>
            </li>
        </ul>
    </header>

    {% if patch.is_binary %}
        <p class="noresult">Binary diffs cannot be rendered.</p>
    {% else %}
        {% autoescape false %}
        {{ patch|patch_to_diff|html_diff}}
        {% endautoescape %}
    {% endif %}
</section>

{% endfor %}

{% endblock %}