emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for async


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for asynchronous change detection
Date: Sat, 27 Mar 2021 14:48:49 -0400 (EDT)

branch: externals/ssh-deploy
commit 7d578daa042055a7dba2947011d0918ae5544fcc
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Passing unit test for asynchronous change detection
---
 ssh-deploy-test.el | 26 ++++++++++++++++----------
 ssh-deploy.el      | 13 ++++++++++---
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index 61b8026..15f89d1 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -300,7 +300,7 @@
 
         ;; Update should not trigger upload
         (find-file file-b)
-        (insert "Random blbob")
+        (insert "Random blob")
         (save-buffer)
         (kill-buffer)
 
@@ -311,8 +311,13 @@
         (if (> async 0)
             (progn
               (ssh-deploy--async-process
-               (lambda() (ssh-deploy--remote-changes-data file-a))
-               (lambda(response) (should (equal 5 (nth 0 response))))
+               `(lambda()
+                 ;; (format "root local 2: %s, root remote: %s, 
revision-folder: %s, exclude-list: %s" ,ssh-deploy-root-local 
,ssh-deploy-root-remote ,ssh-deploy-revision-folder ,ssh-deploy-exclude-list)
+                 (ssh-deploy--remote-changes-data ,file-a 
,ssh-deploy-root-local ,ssh-deploy-root-remote ,ssh-deploy-revision-folder)
+                 )
+               (lambda(response)
+                 ;;(message "Response: %s" response)
+                 (should (equal 5 (nth 0 response))))
                async-with-threads)
               (sleep-for 1))
           (should (equal 5 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
@@ -328,8 +333,9 @@
         (if (> async 0)
             (progn
               (ssh-deploy--async-process
-               (lambda() (ssh-deploy--remote-changes-data file-a))
-               (lambda(response) (should (equal 4 (nth 0 response))))
+               `(lambda()
+                 (ssh-deploy--remote-changes-data ,file-a 
,ssh-deploy-root-local ,ssh-deploy-root-remote ,ssh-deploy-revision-folder))
+               (lambda(response)(should (equal 4 (nth 0 response))))
                async-with-threads)
               (sleep-for 1))
           (should (equal 4 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
@@ -377,11 +383,6 @@
       (ssh-deploy-test--file-is-in-path)
       (ssh-deploy-test--is-not-empty-string)
 
-      (ssh-deploy-test--detect-remote-changes 0 0)
-      (when async-el
-        (ssh-deploy-test--detect-remote-changes 1 0))
-      (ssh-deploy-test--detect-remote-changes 1 1)
-
       (ssh-deploy-test--upload 0 0)
       (when async-el
         (ssh-deploy-test--upload 1 0))
@@ -397,6 +398,11 @@
         (ssh-deploy-test--rename-and-delete 1 0))
       (ssh-deploy-test--rename-and-delete 1 1)
 
+      (ssh-deploy-test--detect-remote-changes 0 0)
+      (when async-el
+        (ssh-deploy-test--detect-remote-changes 1 0))
+      (ssh-deploy-test--detect-remote-changes 1 1)
+
       (delete-directory revision-folder t)
 
 
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 91f74e8..281a707 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -306,7 +306,11 @@
         (display-warning 'ssh-deploy "make-thread function are not 
available!"))
     (if (fboundp 'async-start)
         (when start
-          (let ((ftp-netrc nil))
+          (let ((ftp-netrc nil)
+                (root-local ssh-deploy-root-local)
+                (root-remote ssh-deploy-root-remote)
+                (revision-folder ssh-deploy-revision-folder)
+                (exclude-list ssh-deploy-exclude-list))
             (when (boundp 'ange-ftp-netrc-filename)
               (setq ftp-netrc ange-ftp-netrc-filename))
             (let ((script-filename (file-name-directory (symbol-file 
'ssh-deploy-diff-directories))))
@@ -316,11 +320,14 @@
                        (ssh-deploy-async-with-threads 0)
                        (ssh-deploy-on-explicit-save 0)
                        (ssh-deploy-automatically-detect-remote-changes 0)
-                       (ssh-deploy-revision-folder ssh-deploy-revision-folder)
-                       (ssh-deploy-exclude-list ssh-deploy-exclude-list))
+                       (ssh-deploy-root-local root-local)
+                       (ssh-deploy-root-remote root-remote)
+                       (ssh-deploy-revision-folder revision-folder)
+                       (ssh-deploy-exclude-list exclude-list))
                    (when ftp-netrc
                      ;; Pass ange-ftp setting to asynchronous process
                      (defvar ange-ftp-netrc-filename ftp-netrc))
+
                    (add-to-list 'load-path script-filename)
                    (autoload 'ediff-same-file-contents "ediff-util")
                    (autoload 'string-remove-prefix "subr-x")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]