From 75d5e4b9d5bdaf86329b33f25b824c506e190b79 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 21 Nov 2019 20:48:58 +0000 Subject: Fix select-guix-revision-for-branch-and-datetime Flip the inequality and order, as this was picking the first revision after the datetime, rather than the last revision before it, which was the intention, as this should give you the revision on the branch, at the datetime. --- guix-data-service/model/guix-revision.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix-data-service/model/guix-revision.scm b/guix-data-service/model/guix-revision.scm index 8221ab4..8578008 100644 --- a/guix-data-service/model/guix-revision.scm +++ b/guix-data-service/model/guix-revision.scm @@ -72,8 +72,8 @@ FROM guix_revisions INNER JOIN git_branches ON git_branches.commit = guix_revisions.commit AND git_branches.git_repository_id = guix_revisions.git_repository_id -WHERE git_branches.name = $1 AND git_branches.datetime >= $2 -ORDER BY git_branches.datetime ASC +WHERE git_branches.name = $1 AND git_branches.datetime <= $2 +ORDER BY git_branches.datetime DESC LIMIT 1") (car -- cgit v1.2.3