aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2020-03-09 16:05:21 +0100
committerMichael Albinus2020-03-09 16:05:21 +0100
commita1e2a6847007f56d96d0122e493d5228e5c4d08b (patch)
treeaca427daf304376b8745446c4ba26252a0f7b98c /test
parenta461baae79af3cea8780e9d9a845a1e859e96e5e (diff)
downloademacs-a1e2a6847007f56d96d0122e493d5228e5c4d08b.tar.gz
emacs-a1e2a6847007f56d96d0122e493d5228e5c4d08b.zip
Finish implementation of set-file-times FLAG arg in Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times): Implement FLAG. (tramp-adb-handle-copy-file): Adapt `set-file-times' call. * lisp/net/tramp-compat.el (tramp-compat-set-file-times): New defalias. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes) (tramp-gvfs-handle-set-file-times, tramp-gvfs-set-file-uid-gid): Simplify `tramp-gvfs-url-file-name' call. * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times): Implement FLAG. (tramp-do-copy-or-rename-file-via-buffer) (tramp-do-copy-or-rename-file-out-of-band): Add optional argument OK-IF-ALREADY-EXISTS. Adapt callees. (tramp-do-copy-or-rename-file-via-buffer) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band): Adapt `set-file-times' call. * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file): Adapt `set-file-times' call. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file): Adapt `set-file-times' call. (tramp-sudoedit-handle-set-file-times): Implement FLAG. * test/lisp/net/tramp-tests.el (tramp-test22-file-times): Extend test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index dcf376e70b4..e220420d8cf 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3743,8 +3743,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3743 (file-attributes tmp-name1)))) 3743 (file-attributes tmp-name1))))
3744 ;; Skip the test, if the remote handler is not able to set 3744 ;; Skip the test, if the remote handler is not able to set
3745 ;; the correct time. 3745 ;; the correct time.
3746 (skip-unless (set-file-times tmp-name1 (seconds-to-time 1) 3746 (skip-unless (set-file-times tmp-name1 (seconds-to-time 1)))
3747 'nofollow))
3748 ;; Dumb remote shells without perl(1) or stat(1) are not 3747 ;; Dumb remote shells without perl(1) or stat(1) are not
3749 ;; able to return the date correctly. They say "don't know". 3748 ;; able to return the date correctly. They say "don't know".
3750 (unless (tramp-compat-time-equal-p 3749 (unless (tramp-compat-time-equal-p
@@ -3761,7 +3760,17 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3761 (should (file-newer-than-file-p tmp-name2 tmp-name1)) 3760 (should (file-newer-than-file-p tmp-name2 tmp-name1))
3762 ;; `tmp-name3' does not exist. 3761 ;; `tmp-name3' does not exist.
3763 (should (file-newer-than-file-p tmp-name2 tmp-name3)) 3762 (should (file-newer-than-file-p tmp-name2 tmp-name3))
3764 (should-not (file-newer-than-file-p tmp-name3 tmp-name1)))) 3763 (should-not (file-newer-than-file-p tmp-name3 tmp-name1))
3764 ;; Check the NOFOLLOW arg. It exists since Emacs 28. For
3765 ;; regular files, there shouldn't be a difference.
3766 (when (tramp--test-emacs28-p)
3767 (with-no-warnings
3768 (set-file-times tmp-name1 (seconds-to-time 1) 'nofollow)
3769 (should
3770 (tramp-compat-time-equal-p
3771 (tramp-compat-file-attribute-modification-time
3772 (file-attributes tmp-name1))
3773 (seconds-to-time 1)))))))
3765 3774
3766 ;; Cleanup. 3775 ;; Cleanup.
3767 (ignore-errors 3776 (ignore-errors