Sync with Tramp 2.7.1

* doc/misc/trampver.texi:
* lisp/net/trampver.el (tramp-version): Adapt Tramp versions.
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 30.1.

* lisp/net/tramp-compat.el:
* lisp/net/tramp-message.el (tramp-warning): Use `lwarn'.

* test/lisp/net/tramp-tests.el
(tramp--test-deftest-without-file-attributes): New defmacro.
(tramp-test18-file-attributes-without-file-attributes)
(tramp-test19-directory-files-and-attributes-without-file-attributes)
(tramp-test18-file-attributes-without-file-attributes)
(tramp-test42-utf8-without-file-attributes): New tests.
This commit is contained in:
Michael Albinus 2024-06-29 10:13:32 +02:00
parent a5726782d0
commit f0a4879975
5 changed files with 63 additions and 17 deletions

View file

@ -7,7 +7,7 @@
@c In the Tramp GIT, the version number and the bug report address
@c are auto-frobbed from configure.ac.
@set trampver 2.7.1-pre
@set trampver 2.7.1
@set trampurl https://www.gnu.org/software/tramp/
@set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 27.1

View file

@ -46,18 +46,22 @@
(unless (= emacs-major-version
(car (version-to-list tramp-compat-emacs-compiled-version)))
(warn "Tramp has been compiled with Emacs %s, this is Emacs %s"
(lwarn 'tramp :warning
"Tramp has been compiled with Emacs %s, this is Emacs %s"
tramp-compat-emacs-compiled-version emacs-version))
(with-eval-after-load 'docker-tramp
(warn (concat "Package `docker-tramp' has been obsoleted, "
"please use integrated package `tramp-container'")))
(lwarn 'tramp :warning
(concat "Package `docker-tramp' has been obsoleted, "
"please use integrated package `tramp-container'")))
(with-eval-after-load 'kubernetes-tramp
(warn (concat "Package `kubernetes-tramp' has been obsoleted, "
"please use integrated package `tramp-container'")))
(lwarn 'tramp :warning
(concat "Package `kubernetes-tramp' has been obsoleted, "
"please use integrated package `tramp-container'")))
(with-eval-after-load 'tramp-nspawn
(warn (concat "Package `tramp-nspawn' has been obsoleted, "
"please use integrated package `tramp-container'")))
(lwarn 'tramp :warning
(concat "Package `tramp-nspawn' has been obsoleted, "
"please use integrated package `tramp-container'")))
;; For not existing functions, obsolete functions, or functions with a
;; changed argument list, there are compiler warnings. We want to

View file

@ -468,8 +468,7 @@ to `tramp-message'."
(declare (tramp-suppress-trace t))
(let (signal-hook-function)
(apply 'tramp-message vec-or-proc 2 fmt-string arguments)
(display-warning
'tramp (apply #'format-message fmt-string arguments) :warning)))
(lwarn 'tramp :warning fmt-string arguments)))
(defun tramp-test-message (fmt-string &rest arguments)
"Emit a Tramp message according `default-directory'."

View file

@ -7,7 +7,7 @@
;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;; Package: tramp
;; Version: 2.7.1-pre
;; Version: 2.7.1
;; Package-Requires: ((emacs "27.1"))
;; Package-Type: multi
;; URL: https://www.gnu.org/software/tramp/
@ -40,7 +40,7 @@
;; ./configure" to change them.
;;;###tramp-autoload
(defconst tramp-version "2.7.1-pre"
(defconst tramp-version "2.7.1"
"This version of Tramp.")
;;;###tramp-autoload
@ -78,7 +78,7 @@
;; Check for Emacs version.
(let ((x (if (not (string-version-lessp emacs-version "27.1"))
"ok"
(format "Tramp 2.7.1-pre is not fit for %s"
(format "Tramp 2.7.1 is not fit for %s"
(replace-regexp-in-string "\n" "" (emacs-version))))))
(unless (string-equal "ok" x) (error "%s" x)))
@ -106,7 +106,8 @@
("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2")
("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") ("2.5.4" . "28.3")
("2.6.0.29.1" . "29.1") ("2.6.2.29.2" . "29.2") ("2.6.3-pre" . "29.3")
("2.6.3" . "29.4")))
("2.6.3" . "29.4")
("2.7.1" . "30.1")))
(add-hook 'tramp-unload-hook
(lambda ()

View file

@ -3904,12 +3904,44 @@ The test is derived from TEST and COMMAND."
(funcall (ert-test-body ert-test)))
(ert-skip (format "Test `%s' must run before" ',test)))))
(defmacro tramp--test-deftest-without-file-attributes (test)
"Define ert `TEST-without-file-attributes'."
(declare (indent 1))
`(ert-deftest
,(intern (concat (symbol-name test) "-without-file-attributes")) ()
:tags '(:expensive-test)
(let ((test-doc
(split-string
(ert-test-documentation (get ',test 'ert--test)) "\n")))
;; The first line must be extended.
(setcar
test-doc
(format "%s Don't Use the \"file-attributes\" cache." (car test-doc)))
(setf (ert-test-documentation
(get
(intern (format "%s-without-file-attributes" ',test))
'ert--test))
(string-join test-doc "\n")))
(skip-unless (tramp--test-enabled))
(skip-unless
(or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sudoedit-p)))
(if-let ((default-directory ert-remote-temporary-file-directory)
(ert-test (ert-get-test ',test))
(result (ert-test-most-recent-result ert-test)))
(progn
(skip-unless (< (ert-test-result-duration result) 300))
(let (tramp-use-file-attributes)
(funcall (ert-test-body ert-test))))
(ert-skip (format "Test `%s' must run before" ',test)))))
(tramp--test-deftest-with-stat tramp-test18-file-attributes)
(tramp--test-deftest-with-perl tramp-test18-file-attributes)
(tramp--test-deftest-with-ls tramp-test18-file-attributes)
(tramp--test-deftest-without-file-attributes tramp-test18-file-attributes)
(defvar tramp--test-start-time nil
"Keep the start time of the current test, a float number.")
@ -4034,6 +4066,9 @@ They might differ only in time attributes or directory size."
(tramp--test-deftest-with-ls tramp-test19-directory-files-and-attributes)
(tramp--test-deftest-without-file-attributes
tramp-test19-directory-files-and-attributes)
(ert-deftest tramp-test20-file-modes ()
"Check `file-modes'.
This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
@ -6839,7 +6874,8 @@ INPUT, if non-nil, is a string sent to the process."
(set-visited-file-name tmp-name1)
(insert "foo")
(should (buffer-modified-p))
(tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
(tramp-cleanup-connection
tramp-test-vec 'keep-debug 'keep-password)
(cl-letf (((symbol-function #'read-from-minibuffer)
(lambda (&rest _args) "yes")))
(kill-buffer)))
@ -7561,6 +7597,8 @@ This requires restrictions of file name syntax."
(tramp--test-deftest-with-ls tramp-test41-special-characters)
(tramp--test-deftest-without-file-attributes tramp-test41-special-characters)
(ert-deftest tramp-test42-utf8 ()
"Check UTF8 encoding in file names and file contents."
(skip-unless (tramp--test-enabled))
@ -7627,6 +7665,8 @@ This requires restrictions of file name syntax."
(tramp--test-deftest-with-ls tramp-test42-utf8)
(tramp--test-deftest-without-file-attributes tramp-test42-utf8)
(ert-deftest tramp-test43-file-system-info ()
"Check that `file-system-info' returns proper values."
(skip-unless (tramp--test-enabled))
@ -7864,10 +7904,12 @@ process sentinels. They shall not disturb each other."
(should-not (file-attributes file))
(should (file-attributes file)))
;; Send string to process.
(process-send-string proc (format "%s\n" (buffer-name buf)))
(process-send-string
proc (format "%s\n" (buffer-name buf)))
(while (accept-process-output nil 0))
(tramp--test-message
"Continue action %d %s %s" count buf (current-time-string))
"Continue action %d %s %s"
count buf (current-time-string))
;; Regular operation post process action.
(dired-uncache file)
(if (= count 2)