From 7fbcca29b883e68b7a92d4bc706aa0a0bd19b5a4 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 29 Dec 2020 15:36:38 +0100 Subject: [PATCH] Sync with Tramp 2.5.0 * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.5.0". * test/lisp/net/tramp-tests.el (tramp--test--deftest-direct-async-process): Check, that `make-process' supports file name handlers. Suppress `internal-default-process-sentinel'. (tramp--test-async-shell-command): Set `proc' proper. (tramp-test32-shell-command-direct-async): Tag it :unstable. --- doc/misc/trampver.texi | 2 +- lisp/net/tramp-adb.el | 7 ++++++ lisp/net/trampver.el | 6 ++--- test/lisp/net/tramp-tests.el | 48 ++++++++++++++++++++---------------- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index dbebbc36812..ba98a7e31fb 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version numbers are auto-frobbed from @c tramp.el, and the bug report address is auto-frobbed from @c configure.ac. -@set trampver 2.5.0-pre +@set trampver 2.5.0 @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 25.1 diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 9ea72668e7b..2d702b6b0af 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1131,6 +1131,13 @@ This happens for Android >= 4.0." (if (string-match-p "[[:multibyte:]]" command) ;; Multibyte codepoints with four bytes are not supported at ;; least by toybox. + + ;; + ;; mksh uses UTF-8 internally, but is currently limited to the + ;; BMP (basic multilingua plane), which means U+0000 to + ;; U+FFFD. If you want to use SMP codepoints (U-00010000 to + ;; U-0010FFFD) on the input line, you currently have to disable + ;; the UTF-8 mode (sorry). (tramp-adb-execute-adb-command vec "shell" command) (unless neveropen (tramp-adb-maybe-open-connection vec)) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 30e5ba8151b..f4e470e5a8c 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.5.0-pre +;; Version: 2.5.0 ;; Package-Requires: ((emacs "25.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.5.0-pre" +(defconst tramp-version "2.5.0" "This version of Tramp.") ;;;###tramp-autoload @@ -76,7 +76,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "25.1")) "ok" - (format "Tramp 2.5.0-pre is not fit for %s" + (format "Tramp 2.5.0 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c8756627936..197eed74ee0 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4475,23 +4475,30 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." "Define ert test `TEST-direct-async' for direct async processes. If UNSTABLE is non-nil, the test is tagged as `:unstable'." (declare (indent 1)) - `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) () - ,docstring - :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test)) - (skip-unless (tramp--test-enabled)) - (let ((default-directory tramp-test-temporary-file-directory) - (ert-test (ert-get-test ',test)) - (tramp-connection-properties - (cons '(nil "direct-async-process" t) tramp-connection-properties))) - (skip-unless (tramp-direct-async-process-p)) - ;; For whatever reason, it doesn't cooperate with the "mock" method. - (skip-unless (not (tramp--test-mock-p))) - ;; We do expect an established connection already, - ;; `file-truename' does it by side-effect. Suppress - ;; `tramp--test-enabled', in order to keep the connection. - (cl-letf (((symbol-function #'tramp--test-enabled) (lambda nil t))) - (file-truename tramp-test-temporary-file-directory) - (funcall (ert-test-body ert-test)))))) + ;; `make-process' supports file name handlers since Emacs 27. + (when (let ((file-name-handler-alist '(("" . (lambda (&rest _) t))))) + (ignore-errors (make-process :file-handler t))) + `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) () + ,docstring + :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test)) + (skip-unless (tramp--test-enabled)) + (let ((default-directory tramp-test-temporary-file-directory) + (ert-test (ert-get-test ',test)) + (tramp-connection-properties + (cons '(nil "direct-async-process" t) + tramp-connection-properties))) + (skip-unless (tramp-direct-async-process-p)) + ;; For whatever reason, it doesn't cooperate with the "mock" method. + (skip-unless (not (tramp--test-mock-p))) + ;; We do expect an established connection already, + ;; `file-truename' does it by side-effect. Suppress + ;; `tramp--test-enabled', in order to keep the connection. + ;; Suppress "Process ... finished" messages. + (cl-letf (((symbol-function #'tramp--test-enabled) (lambda nil t)) + ((symbol-function #'internal-default-process-sentinel) + #'ignore)) + (file-truename tramp-test-temporary-file-directory) + (funcall (ert-test-body ert-test))))))) (tramp--test--deftest-direct-async-process tramp-test29-start-file-process "Check direct async `start-file-process'.") @@ -4704,8 +4711,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." (command output-buffer &optional error-buffer input) "Like `async-shell-command', reading the output. INPUT, if non-nil, is a string sent to the process." - (async-shell-command command output-buffer error-buffer) - (let ((proc (get-buffer-process output-buffer)) + (let ((proc (async-shell-command command output-buffer error-buffer)) (delete-exited-processes t)) (cl-letf (((symbol-function #'shell-command-sentinel) #'ignore)) (when (stringp input) @@ -4818,7 +4824,7 @@ INPUT, if non-nil, is a string sent to the process." (should (= cols async-shell-command-width)))))) (tramp--test--deftest-direct-async-process tramp-test32-shell-command - "Check direct async `shell-command'.") + "Check direct async `shell-command'." 'unstable) ;; This test is inspired by Bug#39067. (ert-deftest tramp-test32-shell-command-dont-erase-buffer () @@ -6452,7 +6458,7 @@ process sentinels. They shall not disturb each other." (ignore-errors (delete-directory tmp-name 'recursive)))))) ;; (tramp--test--deftest-direct-async-process tramp-test43-asynchronous-requests -;; "Check parallel direct asynchronous requests.") +;; "Check parallel direct asynchronous requests." 'unstable) ;; This test is inspired by Bug#29163. (ert-deftest tramp-test44-auto-load () -- 2.39.5