home » zplus/clif.git
Author zPlus <zplus@peers.community> 2022-08-05 05:23:23
Committer zPlus <zplus@peers.community> 2022-08-05 05:23:23
Commit 9804d86 (patch)
Tree 8833e19
Parent(s)

Fix Log diffstats when commit has no parents. Do not display diffstats in the Log page for commit with no parents (first commit).


commits diff: 2071174..9804d86
2 files changed, 9 insertions, 3 deletionsdownload


Diffstat
-rw-r--r-- templates/repository/log.html 8
-rw-r--r-- web.py 4

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+6/-2 M   templates/repository/log.html
index 696fe32..2ddb8f8
old size: 4K - new size: 4K
@@ -72,10 +72,14 @@
72 72 {{ commit_time(commit.commit_time, commit.commit_time_offset)|ago }}
73 73 </td>
74 74 <td class="files">
75 - {{ diff[commit.short_id].stats.files_changed }}
75 + {% if commit.short_id in diff %}
76 + {{ diff[commit.short_id].stats.files_changed }}
77 + {% endif %}
76 78 </td>
77 79 <td class="lines">
78 - <span class="deletions">-{{ diff[commit.short_id].stats.deletions }}</span>/<span class="insertions">+{{ diff[commit.short_id].stats.insertions }}</span>
80 + {% if commit.short_id in diff %}
81 + <span class="deletions">-{{ diff[commit.short_id].stats.deletions }}</span>/<span class="insertions">+{{ diff[commit.short_id].stats.insertions }}</span>
82 + {% endif %}
79 83 </td>
80 84 </tr>
81 85 {% endfor %}

+3/-1 M   web.py
index b1331f9..4386480
old size: 25K - new size: 25K
@@ -505,7 +505,9 @@ def log(repository, revision):
505 505 break
506 506
507 507 commits.append(commit)
508 - diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
508 +
509 + if len(commit.parents) > 0:
510 + diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
509 511
510 512 return template(
511 513 'repository/log.html',