[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only wi
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61] |
Date: |
Sat, 27 Mar 2021 14:48:56 -0400 (EDT) |
branch: externals/ssh-deploy
commit d0f7294d23380766dcabdb4ed21bc6a68e496110
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
When remote differs only with local-revision, update local-revision [#61]
---
ssh-deploy-test.el | 27 ++++++++++++++++++---------
ssh-deploy.el | 10 +++++-----
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index ce507e6..9f9fc94 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -272,6 +272,7 @@
ssh-deploy-async
ssh-deploy-async-with-threads)
+ ;; Modify local file, remote file should be automatically uploaded
(ssh-deploy-add-after-save-hook)
(find-file file-a)
(insert file-a-contents)
@@ -281,17 +282,16 @@
(kill-buffer)
;; Verify that both files have equal contents
+ (should (equal t (nth 0 (ssh-deploy--diff-files file-a
revision-file))))
(should (equal t (nth 0 (ssh-deploy--diff-files file-a file-b))))
- ;; Modify local revision here
-
- ;; Update should not trigger upload
+ ;; Modify only local revision
(find-file revision-file)
(insert "Random blob")
(save-buffer)
(kill-buffer)
- ;; Verify that both files don't have equal contents
+ ;; Verify that both files don't have equal contents anymore
(should (equal nil (nth 0 (ssh-deploy--diff-files file-a
revision-file))))
;; Remote file should signal change now
@@ -299,13 +299,22 @@
(progn
(ssh-deploy--async-process
(lambda() (ssh-deploy--remote-changes-data file-a))
- (lambda(response) (should (equal 5 (nth 0 response))))
+ (lambda(response)
+ (should (equal 8 (nth 0 response))))
async-with-threads)
(sleep-for 1))
- (should (equal 5 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
+ (let ((response (ssh-deploy--remote-changes-data file-a)))
+ (should (equal 8 (nth 0 response)))))
+
+ ;; Run post-executor that should copy local-file to revision-file
+ (ssh-deploy--remote-changes-post-executor (list 8 "" file-a
revision-file) ssh-deploy-verbose)
+
+ ;; Verify that both files have equal contents again
+ (should (equal t (nth 0 (ssh-deploy--diff-files file-a
revision-file))))
+ (should (equal t (nth 0 (ssh-deploy--diff-files file-a file-b))))
;; Update should now trigger upload
- (find-file file-a)
+ (find-file file-b)
(insert "Random blob")
(save-buffer)
(kill-buffer)
@@ -315,10 +324,10 @@
(progn
(ssh-deploy--async-process
(lambda() (ssh-deploy--remote-changes-data file-a))
- (lambda(response) (should (equal 8 (nth 0 response))))
+ (lambda(response) (should (equal 5 (nth 0 response))))
async-with-threads)
(sleep-for 1))
- (should (equal 8 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
+ (should (equal 5 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
;; Open file-a and download remote
(find-file file-a)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 0c7e0cd..ff86e4a 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -5,8 +5,8 @@
;; Author: Christian Johansson <christian@cvj.se>
;; Maintainer: Christian Johansson <christian@cvj.se>
;; Created: 5 Jul 2016
-;; Modified: 10 Jun 2019
-;; Version: 3.1.5
+;; Modified: 17 Aug 2019
+;; Version: 3.1.6
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -788,7 +788,7 @@
;; Remote file has not changed
(when (> verbose 0) (message (nth 1 response))))
(5
- ;; Remote file has changed in comparison with local revision
+ ;; Remote file has changed in comparison with local revision but also
with local file
(display-warning 'ssh-deploy (nth 1 response) :warning))
(6
;; Remote file has not changed in comparison with local file
@@ -827,8 +827,8 @@
(if (nth 0 (ssh-deploy--diff-files revision-path
path-remote))
(list 4 (format "Remote file '%s' has not
changed." path-remote) path-local)
(if (nth 0 (ssh-deploy--diff-files path-local
path-remote))
- (list 5 (format "Remote file '%s' has changed
compared to local revision and local file, please download or diff."
path-remote) path-local revision-path)
- (list 8 (format "Remote file '%s' has changed
compared to local revision but not local file, copied local file to local
revision." path-remote) path-local revision-path)))
+ (list 8 (format "Remote file '%s' has changed
compared to local revision but not local file, copied local file to local
revision." path-remote) path-local revision-path)
+ (list 5 (format "Remote file '%s' has changed
compared to local revision and local file, please download or diff."
path-remote) path-local revision-path)))
(if (nth 0 (ssh-deploy--diff-files path-local
path-remote))
(list 6 (format "Remote file '%s' has not changed
compared to local file, created local revision." path-remote) path-local
revision-path)
- [elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for asynchronous change detection, (continued)
- [elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for asynchronous change detection, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 20a87ab 099/133: Added async.el to travis test, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 761eb11 098/133: Updated Travis to use emacs version snapshot, 25.1 and 26.1 via EVM, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 0111640 108/133: Removed unnecessary async autoloads, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ea734f5 104/133: Added note, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 49ae447 097/133: Fixed Travis build status logo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a5aa5f6 093/133: Run only async test with threads if threads are available, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy b8f976a 116/133: Passing verbose flag to diff files function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e1507fe 119/133: Create FUNDING.yml, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 37a15c6 118/133: fix: ".git" matching, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61],
Stefan Monnier <=
- [elpa] externals/ssh-deploy e133963 125/133: Default exclude value for DirectoryVariables now matches only .dir-locals.el, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 168c66d 114/133: Updated .gitignore to ignore test-generated files, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 93a0e18 128/133: Resolved hydra declaration if hydra is not installed, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 89bb950 131/133: Merge pull request #69 from housensen/patch-1, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 7a5a087 066/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async function error and replaced require with autoload, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8c354e1 092/133: Added Travis CI file to repo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f61f1ef 041/133: Fixed bug where all DirectoryVariables was not passed on from handlers, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling with (if), (progn) and (when), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (progn) optimizations, Stefan Monnier, 2021/03/27