Author
|
zPlus <zplus@peers.community>
2022-08-05 05:15:00
|
Committer
|
zPlus <zplus@peers.community>
2022-08-05 05:15:00
|
Commit
|
2071174
(patch)
|
Tree
|
b5cbcc2
|
Parent(s)
|
|
Add diffstats to Log page.
Show changed files and lines.
commits diff:
87759ce..2071174
3 files changed,
37 insertions,
3 deletions
—
download
Diffstat
Diff options
+26/-2
M static/css/clif.css
+8/-0
M templates/repository/log.html
40
|
40
|
|
<td class="id">ID</td>
|
41
|
41
|
|
<td class="message">Message</td>
|
42
|
42
|
|
<td class="time">Commit time</td>
|
|
43
|
+ |
<td class="files">Files</td>
|
|
44
|
+ |
<td class="lines">Lines</td>
|
43
|
45
|
|
</tr>
|
44
|
46
|
|
</thead>
|
45
|
47
|
|
|
69
|
71
|
|
<td class="time" title="{{ commit_time(commit.commit_time, commit.commit_time_offset) }}">
|
70
|
72
|
|
{{ commit_time(commit.commit_time, commit.commit_time_offset)|ago }}
|
71
|
73
|
|
</td>
|
|
74
|
+ |
<td class="files">
|
|
75
|
+ |
{{ diff[commit.short_id].stats.files_changed }}
|
|
76
|
+ |
</td>
|
|
77
|
+ |
<td class="lines">
|
|
78
|
+ |
<span class="deletions">-{{ diff[commit.short_id].stats.deletions }}</span>/<span class="insertions">+{{ diff[commit.short_id].stats.insertions }}</span>
|
|
79
|
+ |
</td>
|
72
|
80
|
|
</tr>
|
73
|
81
|
|
{% endfor %}
|
74
|
82
|
|
</tbody>
|
+3/-1
M web.py
492
|
492
|
|
except: commits_offset = 0
|
493
|
493
|
|
|
494
|
494
|
|
commits = []
|
|
495
|
+ |
diff = {}
|
495
|
496
|
|
commit_ith = 0
|
496
|
497
|
|
for commit in repo.walk(git_object.id):
|
497
|
498
|
|
# Skip the first one (offset)
|
504
|
505
|
|
break
|
505
|
506
|
|
|
506
|
507
|
|
commits.append(commit)
|
|
508
|
+ |
diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
|
507
|
509
|
|
|
508
|
510
|
|
return template(
|
509
|
511
|
|
'repository/log.html',
|
510
|
512
|
|
heads=heads, head_ref=HEAD, tags=tags,
|
511
|
|
- |
commits=commits,
|
|
513
|
+ |
commits=commits, diff=diff,
|
512
|
514
|
|
log_pagination=LOG_PAGINATION, offset=commits_offset,
|
513
|
515
|
|
repository=repository, revision=revision)
|
514
|
516
|
|
|