From b771bf3f4fa73e1f1544114bf799e3a2361feafa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 31 2016 15:45:12 +0000 Subject: Fix the tests for older version of pygit2 where Patch does not have line_stats --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 96bd6a1..b0121bd 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -421,13 +421,21 @@
empty file added
{% else %} - {% if patchtype == "added" and patch.line_stats[1] > 1000 %} + {% if patchtype == "added" %} + {% if (patch| hasattr('line_stats') and patch.line_stats[1] > 1000) + or (patch| hasattr('additions') and patch.additions > 1000) %}
-
View the large added file {{ viewfilelink(patch_new_file_path) }}
+
+ The added file is too large to be shown here, see it at: + {{ viewfilelink(patch_new_file_path) }} +
{% elif patchtype == "removed" %}
-
view the removed file {{ viewfilelink(patch_new_file_path, patch_old_id) }}
+
+ The removed file is too large to be shown here, see it at: + {{ viewfilelink(patch_new_file_path, patch_old_id) }} +
{% else %} {% autoescape false %}