From f5b97b439a2a1a7d13c60f1b711edf704542a038 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 30 Mar 2023 00:38:30 +1100 Subject: fixing a bug where build view shows the wrong revision info ...by correcting outdated revision info when opening build view. --- buildbot-utils.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'buildbot-utils.el') diff --git a/buildbot-utils.el b/buildbot-utils.el index 3f79d63..57c0a22 100644 --- a/buildbot-utils.el +++ b/buildbot-utils.el @@ -140,27 +140,29 @@ builds) results)) -(defun buildbot-get-revision-and-changes-info (changes) - "Get revision-info and builds from a set of changes of the same revision. +(defun buildbot-get-revision-info-from-change (change) + (list + (assq 'revision change) + (assq 'author change) + (cons 'created-at + (buildbot-format-epoch-time + (alist-get 'when_timestamp change))) + (assq 'comments change))) -Concat all builds." - (let* ((changes-info +(defun buildbot-get-revision-and-changes-info (changes) + "Get revision-info and builds from a set of changes of the same revision." + (let* ((first-change (elt changes 0)) + (revision-info (buildbot-get-revision-info-from-change first-change)) + (changes-info (mapcar (lambda (change) (list (assq 'branch change) (assq 'builds change) (cons 'build-stats (buildbot-get-build-stats - (alist-get 'builds change))))) - changes)) - (first-change (elt changes 0)) - (revision-info (list - (assq 'revision first-change) - (assq 'author first-change) - (cons 'created-at - (buildbot-format-epoch-time - (alist-get 'when_timestamp first-change))) - (assq 'comments first-change)))) + (alist-get 'builds change))) + (assq 'revision first-change))) + changes))) `((revision-info . ,revision-info) (changes-info . ,changes-info)))) (provide 'buildbot-utils) -- cgit v1.2.3