[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive d48a0109e0 11/49: WIP: Fixes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive d48a0109e0 11/49: WIP: Fixes |
Date: |
Wed, 20 Sep 2023 19:01:32 -0400 (EDT) |
branch: elpa/hyperdrive
commit d48a0109e03b7798e1a97f71c2898510d03db861
Author: Adam Porter <adam@alphapapa.net>
Commit: Joseph Turner <joseph@ushin.org>
WIP: Fixes
---
hyperdrive-history.el | 2 +-
hyperdrive-lib.el | 63 ++++++++++++++++++++++++---------------------------
2 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/hyperdrive-history.el b/hyperdrive-history.el
index b0fc207ca6..705366fcdc 100644
--- a/hyperdrive-history.el
+++ b/hyperdrive-history.el
@@ -227,7 +227,7 @@ Universal prefix argument \\[universal-argument] forces
(setf (hyperdrive-entry-version range-end-entry) range-end)
(hyperdrive-fill-version-ranges range-end-entry
:finally (lambda ()
- (message "FINALLY")
+ ;; (message "HYPERDRIVE-HISTORY-FILL-VERSION-RANGES: FINALLY")
;; TODO: Should we open the history buffer for entry
;; or range-end-entry or...?
(hyperdrive-history entry)))))
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 172463a346..3ead991d8d 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -799,28 +799,23 @@ Returns the ranges cons cell for ENTRY."
;; (fill-recursively range-end-entry)))))
;; (funcall then))))
-(cl-defun hyperdrive-fill-version-ranges
- (entry &key (limit hyperdrive-fill-version-ranges-limit) finally queue)
+(cl-defun hyperdrive-fill-version-ranges (entry &key finally)
+ ;; FIXME: Docstring.
"Asynchronously fill in versions ranges for ENTRY.
Recurse backward from ENTRY's version, filling unknown entries no
more than LIMIT times. Once all requests return, call FINALLY
-with no arguments.
-
-The QUEUE argument is used in recursive calls."
+with no arguments."
;; NOTE: `hyperdrive-fill-version-ranges' is recursive logically but not
;; technically, because each call is in the async callback.
(declare (indent defun))
(let* ((outstanding-nonexistent-requests-p)
- ;; (finally-ran-p)
(finally (lambda ()
+ ;; (message "Running finally?
OUTSTANDING-NONEXISTENT-REQUESTS-P:%s"
+ ;; outstanding-nonexistent-requests-p)
(unless outstanding-nonexistent-requests-p
- (unwind-protect
- (funcall finally)
- ;; (setf finally-ran-p t)
- )))))
- (unless queue
- (setf queue (make-plz-queue :limit hyperdrive-queue-size
- :finally finally)))
+ (funcall finally))))
+ (queue (make-plz-queue :limit hyperdrive-queue-size
+ :finally finally)))
(cl-labels ((fill-existent (entry limit)
;; For existent entries, send requests in series.
(when (cl-plusp limit)
@@ -829,11 +824,10 @@ The QUEUE argument is used in recursive calls."
(setf (hyperdrive-entry-version entry) (1- range-start))
(when (eq 'unknown (hyperdrive-entry-exists-p entry))
;; Recurse backward through history.
- (hyperdrive-fill-version-ranges entry
- :limit (1- limit) :queue queue)
+ (fill-entry entry :limit (1- limit))
;; Return non-nil to indicate that a request was made.
t))))
- (fill-nonexistent (copy-entry limit)
+ (fill-nonexistent (entry limit)
(let ((nonexistent-queue (make-plz-queue
:limit hyperdrive-queue-size
:finally (lambda ()
@@ -847,7 +841,8 @@ The QUEUE argument is used in recursive calls."
(fill-nonexistent entry new-limit))
;; (unless
finally-ran-p
;; (funcall
finally))
- (funcall
finally)))))))
+ ;; (message
"NONEXISTENT-QUEUE-FINALLY: Calling plz-queue-finally...")
+ (funcall
(plz-queue-finally queue))))))))
;; For nonexistent entries, send requests in parallel.
(cl-dotimes (i hyperdrive-queue-size
outstanding-nonexistent-requests-p)
;; Send the maximum number of simultaneous requests.
@@ -866,30 +861,32 @@ The QUEUE argument is used in recursive calls."
;; the filled-entry is thrown away.
:then (lambda (_filled-entry)
;; (message "KNOWN-EXISTENT: %s"
(hyperdrive-entry-version filled-entry))
- (message "THEN")
+ ;; (message "THEN")
)
:else (lambda (err)
- (message "KNOWN-NONEXISTENT: %s"
(hyperdrive-entry-version entry))
+ ;; (message "KNOWN-NONEXISTENT: %s"
(hyperdrive-entry-version entry))
;; TODO: Better error handling.
(pcase (plz-response-status
(plz-error-response err))
;; FIXME: If plz-error is a curl-error, this
block will fail.
(404 nil)
(_ (signal (car err) (cdr err)))))
:queue nonexistent-queue)
- (setf outstanding-nonexistent-requests-p t)))))
- (let ((copy-entry (hyperdrive-copy-tree entry t)))
- (hyperdrive-fill copy-entry
- ;; `hyperdrive-fill' is only used to fill the version ranges;
- ;; the filled-entry is thrown away.
- :then (lambda (_filled-entry)
- (fill-existent copy-entry limit))
- :else (lambda (err)
- (pcase (plz-response-status (plz-error-response err))
- ;; FIXME: If plz-error is a curl-error, this block will
fail.
- (404
- (fill-nonexistent copy-entry limit))
- (_ (signal (car err) (cdr err)))))
- :queue queue)))))
+ (setf outstanding-nonexistent-requests-p t))))
+ (fill-entry (entry &key (limit
hyperdrive-fill-version-ranges-limit))
+ (let ((copy-entry (hyperdrive-copy-tree entry t)))
+ (hyperdrive-fill copy-entry
+ ;; `hyperdrive-fill' is only used to fill the version
ranges;
+ ;; the filled-entry is thrown away.
+ :then (lambda (_filled-entry)
+ (fill-existent copy-entry limit))
+ :else (lambda (err)
+ (pcase (plz-response-status (plz-error-response
err))
+ ;; FIXME: If plz-error is a curl-error, this
block will fail.
+ (404
+ (fill-nonexistent copy-entry limit))
+ (_ (signal (car err) (cdr err)))))
+ :queue queue))))
+ (fill-entry entry))))
(defun hyperdrive-fill-metadata (hyperdrive)
"Fill HYPERDRIVE's public metadata and return it.
- [nongnu] elpa/hyperdrive updated (081513c89a -> 9e34eb28d1), ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive c97589207e 04/49: Change: (-history-mode-map) Bind + to -history-fill-version-ranges, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 6021d99388 05/49: Docs: Document keybinding for hyperdrive-history-fill-version-ranges, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 049b18656c 10/49: WIP: (hyperdrive-fill-version-ranges) Ensure FINALLY runs, etc., ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive d48a0109e0 11/49: WIP: Fixes,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 948b2f181f 13/49: Tidy: (hyperdrive-fill-version-ranges) Reduce nesting, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 41081584ef 14/49: Tidy: (-fill-version-ranges) Call finally, not plz-queue-finally, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 1cfdeaea1f 15/49: Change: (hyperdrive-fill-version-ranges) let-bind limit at the top, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 15a9b0ff56 17/49: Tidy: Remove message statements, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 8f9887407f 18/49: Tidy: (hyperdrive-fill-version-ranges) Use ignore, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 3ea4e934db 24/49: Change: (hyperdrive-open) Use hyperdrive-message, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 395d1dd5e0 25/49: Fix: (-fill-version-ranges) Stop filling when loop returns early, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 8dc8f09a82 30/49: Comment: Add TODO, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 77186465d7 33/49: WIP: Fixes, ELPA Syncer, 2023/09/20
- [nongnu] elpa/hyperdrive 1844b57f51 39/49: Fix: (-update-nonexistent-version-range) Add default finally, ELPA Syncer, 2023/09/20