+
+
+
-
+ {% if patchtype == "moved" and linesadded == 0 and linesremoved == 0%}
+
+
file was moved with no change to the file
+
+ {% elif patchtype == "added" and linesadded == 0 %}
+
+ {% else %}
{% autoescape false %}
{{ patch | patch_to_diff | html_diff | format_loc(
filename=patch_new_file_path,
@@ -309,6 +373,7 @@
index=loop.index,
tree_id=diff_commits[0].tree.id)}}
{% endautoescape %}
+ {% endif %}
@@ -505,46 +570,47 @@
-
-
- {% macro changeschangedfile(filepath, added, removed) -%}
+ {% macro changeschangedfile(filepath, added, removed, diffanchor) -%}
+{{added}} -{{removed}}
file changed
{%- endmacro %}
- {% macro changesrenamedfile(oldfilepath, newfilepath, added, removed) -%}
+ {% macro changesrenamedfile(oldfilepath, newfilepath, added, removed, diffanchor) -%}
+{{added}} -{{removed}}
file renamed
{%- endmacro %}
- {% macro changesdeletedfile(filepath, added, removed) -%}
+ {% macro changesdeletedfile(filepath, added, removed, diffanchor) -%}
-{{removed}}
-
file deleted
+
file removed
{%- endmacro %}
- {% macro changesaddedfile(filepath, added, removed) -%}
+ {% macro changesaddedfile(filepath, added, removed, diffanchor) -%}
{%- endmacro %}
+ {% set count = 0 %}
{% for patch in diff %}
+ {% set count = count+1 %}
{% if patch | hasattr('additions') %}
@@ -559,21 +625,21 @@
{% if patch | hasattr('new_file_path') %}
{%- if patch.new_file_path == patch.old_file_path -%}
- {{ changeschangedfile(patch.new_file_path, linesadded, linesremoved) }}
+ {{ changeschangedfile(patch.new_file_path, linesadded, linesremoved, count) }}
{%- else -%}
- {{changesrenamedfile(patch.old_file_path, patch.new_file_path, linesadded, linesremoved)}}
+ {{changesrenamedfile(patch.old_file_path, patch.new_file_path, linesadded, linesremoved, count)}}
{%- endif -%}
{%- elif patch | hasattr('delta') -%}
{%- if patch.delta.new_file.path == patch.delta.old_file.path -%}
{%- if patch.delta.new_file.mode == 0 and patch.delta.old_file.mode == 33188 -%}
- {{ changesdeletedfile(patch.delta.new_file.path, linesadded, linesremoved) }}
+ {{ changesdeletedfile(patch.delta.new_file.path, linesadded, linesremoved, count) }}
{%-elif patch.delta.new_file.mode == 33188 and patch.delta.old_file.mode == 0 -%}
- {{ changesaddedfile(patch.delta.new_file.path, linesadded, linesremoved) }}
+ {{ changesaddedfile(patch.delta.new_file.path, linesadded, linesremoved, count) }}
{%-elif patch.delta.new_file.mode == 33188 and patch.delta.old_file.mode == 33188 -%}
- {{ changeschangedfile(patch.delta.new_file.path, linesadded, linesremoved) }}
+ {{ changeschangedfile(patch.delta.new_file.path, linesadded, linesremoved, count) }}
{%-endif-%}
{%- else -%}
- {{changesrenamedfile(patch.delta.old_file.path, patch.delta.new_file.path, linesadded, linesremoved)}}
+ {{changesrenamedfile(patch.delta.old_file.path, patch.delta.new_file.path, linesadded, linesremoved, count)}}
{%- endif -%}
{%- endif -%}