aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorMichael Albinus2019-08-05 13:09:26 +0200
committerMichael Albinus2019-08-05 13:09:26 +0200
commit6c1d0d53b34d9350d55ebbd83ea56aa751a55f1b (patch)
treecd7a17c72e10ef68d048d17088662cb579644aba /test/lisp
parent1abf76877847226daa5ab7e07000ac1d4aba3478 (diff)
downloademacs-6c1d0d53b34d9350d55ebbd83ea56aa751a55f1b.tar.gz
emacs-6c1d0d53b34d9350d55ebbd83ea56aa751a55f1b.zip
Improve Tramp's caching
* lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory) (tramp-adb-handle-delete-file, tramp-adb-handle-write-region) (tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-set-file-modes) (tramp-gvfs-handle-set-file-times, tramp-gvfs-set-file-uid-gid): * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file) (tramp-rclone-handle-delete-directory) (tramp-rclone-handle-delete-file): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-add-name-to-file) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-delete-directory, tramp-sh-handle-delete-file) (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-delete-file) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link) (tramp-smb-handle-rename-file, tramp-smb-handle-write-region): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-add-name-to-file) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-delete-directory) (tramp-sudoedit-handle-delete-file) (tramp-sudoedit-handle-set-file-modes) (tramp-sudoedit-handle-set-file-times) (tramp-sudoedit-handle-make-symbolic-link): Do not flush all file properties of upper directory. * lisp/net/tramp-cache.el (tramp-flush-file-upper-properties): New defun. (tramp-flush-file-properties, tramp-flush-directory-properties): Use it. * test/lisp/net/tramp-tests.el (tramp-time-diff): Declare. (tramp--test-file-attributes-equal-p): Handle also modification and status change time.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/net/tramp-tests.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index f60dea36bf5..d49914797f5 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -56,6 +56,7 @@
56(declare-function tramp-list-tramp-buffers "tramp-cmds") 56(declare-function tramp-list-tramp-buffers "tramp-cmds")
57(declare-function tramp-method-out-of-band-p "tramp-sh") 57(declare-function tramp-method-out-of-band-p "tramp-sh")
58(declare-function tramp-smb-get-localname "tramp-smb") 58(declare-function tramp-smb-get-localname "tramp-smb")
59(declare-function tramp-time-diff "tramp")
59(defvar auto-save-file-name-transforms) 60(defvar auto-save-file-name-transforms)
60(defvar tramp-connection-properties) 61(defvar tramp-connection-properties)
61(defvar tramp-copy-size-limit) 62(defvar tramp-copy-size-limit)
@@ -3084,9 +3085,18 @@ This tests also `access-file', `file-readable-p',
3084 3085
3085(defsubst tramp--test-file-attributes-equal-p (attr1 attr2) 3086(defsubst tramp--test-file-attributes-equal-p (attr1 attr2)
3086 "Check, whether file attributes ATTR1 and ATTR2 are equal. 3087 "Check, whether file attributes ATTR1 and ATTR2 are equal.
3087They might differ only in access time." 3088They might differ only in time attributes."
3089 ;; Access time.
3088 (setcar (nthcdr 4 attr1) tramp-time-dont-know) 3090 (setcar (nthcdr 4 attr1) tramp-time-dont-know)
3089 (setcar (nthcdr 4 attr2) tramp-time-dont-know) 3091 (setcar (nthcdr 4 attr2) tramp-time-dont-know)
3092 ;; Modification time.
3093 (when (< (abs (tramp-time-diff (nth 5 attr1) (nth 5 attr2))) 5)
3094 (setcar (nthcdr 5 attr1) tramp-time-dont-know)
3095 (setcar (nthcdr 5 attr2) tramp-time-dont-know))
3096 ;; Status change time.
3097 (when (< (abs (tramp-time-diff (nth 6 attr1) (nth 6 attr2))) 5)
3098 (setcar (nthcdr 6 attr1) tramp-time-dont-know)
3099 (setcar (nthcdr 6 attr2) tramp-time-dont-know))
3090 (equal attr1 attr2)) 3100 (equal attr1 attr2))
3091 3101
3092;; This isn't 100% correct, but better than no explainer at all. 3102;; This isn't 100% correct, but better than no explainer at all.