summaryrefslogtreecommitdiff
path: root/guix/scripts/time-machine.scm
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-09 12:22:14 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-09 12:22:14 +0200
commit94ca5b4357af8f8921f0cb0873a7cf316f13aa69 (patch)
tree6ef30120737f26f298f7f17d86597b0b729517e0 /guix/scripts/time-machine.scm
parent6750c114e3e988249f4069d0180316c6d0192350 (diff)
parentdb61bdd7f52270a35bd0a3a88650d98276dab20b (diff)
Merge branch 'master' into emacs-team
Diffstat (limited to 'guix/scripts/time-machine.scm')
-rw-r--r--guix/scripts/time-machine.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index 87000d82ec..3ecf735acb 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -164,13 +164,20 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
(define (validate-guix-channel channels)
"Finds the Guix channel among CHANNELS, and validates that REF as
captured from the closure, a git reference specification such as a commit hash
-or tag associated to CHANNEL, is valid and new enough to satisfy the 'guix
-time-machine' requirements. A `formatted-message' condition is raised
-otherwise."
+or tag associated to the channel, is valid and new enough to satisfy the 'guix
+time-machine' requirements. If the captured REF variable is #f, the reference
+validate is the one of the Guix channel found in CHANNELS. A
+`formatted-message' condition is raised otherwise."
(let* ((guix-channel (find guix-channel? channels))
+ (guix-channel-commit (channel-commit guix-channel))
+ (guix-channel-branch (channel-branch guix-channel))
+ (guix-channel-ref (if guix-channel-commit
+ `(tag-or-commit . ,guix-channel-commit)
+ `(branch . ,guix-channel-branch)))
+ (reference (or ref guix-channel-ref))
(checkout commit relation (update-cached-checkout
(channel-url guix-channel)
- #:ref (or ref '())
+ #:ref reference
#:starting-commit
%oldest-possible-commit)))
(unless (memq relation '(ancestor self))