1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-28 07:50:48 -08:00

Sync with Tramp 2.4.3

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.3".

* lisp/net/tramp.el: Bump version.
(tramp-handle-shell-command): The temp file for error-buffer is remote.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
Simplify buffer generation.
(tramp-test32-shell-command): Extend test.
This commit is contained in:
Michael Albinus 2019-12-29 13:53:06 +01:00
parent 70fe552c61
commit d6922db49d
4 changed files with 29 additions and 20 deletions

View file

@ -8,7 +8,7 @@
@c In the Tramp GIT, the version numbers are auto-frobbed from @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 tramp.el, and the bug report address is auto-frobbed from
@c configure.ac. @c configure.ac.
@set trampver 2.4.3-pre @set trampver 2.4.3
@set tramp-bug-report-address tramp-devel@@gnu.org @set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 24.4 @set emacsver 24.4

View file

@ -7,8 +7,9 @@
;; Maintainer: Michael Albinus <michael.albinus@gmx.de> ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes ;; Keywords: comm, processes
;; Package: tramp ;; Package: tramp
;; Version: 2.4.3-pre ;; Version: 2.4.3
;; Package-Requires: ((emacs "24.4")) ;; Package-Requires: ((emacs "24.4"))
;; Package-Type: multi
;; URL: https://savannah.gnu.org/projects/tramp ;; URL: https://savannah.gnu.org/projects/tramp
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
@ -3681,7 +3682,9 @@ support symbolic links."
(setq buffer (if (and (not asynchronous) error-buffer) (setq buffer (if (and (not asynchronous) error-buffer)
(with-parsed-tramp-file-name default-directory nil (with-parsed-tramp-file-name default-directory nil
(list output-buffer (tramp-make-tramp-temp-file v))) (list output-buffer
(tramp-make-tramp-file-name
v (tramp-make-tramp-temp-file v))))
output-buffer)) output-buffer))
(if current-buffer-p (if current-buffer-p
@ -3735,7 +3738,7 @@ support symbolic links."
(defun tramp-handle-start-file-process (name buffer program &rest args) (defun tramp-handle-start-file-process (name buffer program &rest args)
"Like `start-file-process' for Tramp files." "Like `start-file-process' for Tramp files."
;; `make-process' knows the `:file-error' argument since Emacs 27.1. ;; `make-process' knows the `:file-handler' argument since Emacs 27.1 only.
(tramp-file-name-handler (tramp-file-name-handler
'make-process 'make-process
:name name :name name

View file

@ -39,7 +39,7 @@
(defvar inhibit-message) (defvar inhibit-message)
;;;###tramp-autoload ;;;###tramp-autoload
(defconst tramp-version "2.4.3-pre" (defconst tramp-version "2.4.3"
"This version of Tramp.") "This version of Tramp.")
;;;###tramp-autoload ;;;###tramp-autoload
@ -73,7 +73,7 @@
;; Check for Emacs version. ;; Check for Emacs version.
(let ((x (if (not (string-lessp emacs-version "24.4")) (let ((x (if (not (string-lessp emacs-version "24.4"))
"ok" "ok"
(format "Tramp 2.4.3-pre is not fit for %s" (format "Tramp 2.4.3 is not fit for %s"
(replace-regexp-in-string "\n" "" (emacs-version)))))) (replace-regexp-in-string "\n" "" (emacs-version))))))
(unless (string-equal "ok" x) (error "%s" x))) (unless (string-equal "ok" x) (error "%s" x)))

View file

@ -2902,8 +2902,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
(sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<)))) (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<))))
;; Cleanup. ;; Cleanup.
(ignore-errors (ignore-errors (delete-directory tmp-name1 'recursive))))))
(delete-directory tmp-name1 'recursive))))))
(ert-deftest tramp-test17-insert-directory () (ert-deftest tramp-test17-insert-directory ()
"Check `insert-directory'." "Check `insert-directory'."
@ -4354,8 +4353,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; Process with stderr. tramp-adb.el doesn't support it (yet). ;; Process with stderr. tramp-adb.el doesn't support it (yet).
(unless (tramp--test-adb-p) (unless (tramp--test-adb-p)
(let ((stderr (let ((stderr (generate-new-buffer "*stderr*")))
(generate-new-buffer (generate-new-buffer-name "stderr"))))
(unwind-protect (unwind-protect
(with-temp-buffer (with-temp-buffer
(setq proc (setq proc
@ -4458,6 +4456,20 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; Cleanup. ;; Cleanup.
(ignore-errors (delete-file tmp-name))) (ignore-errors (delete-file tmp-name)))
;; Test `shell-command' with error buffer.
(let ((stderr (generate-new-buffer "*stderr*")))
(unwind-protect
(with-temp-buffer
(shell-command "error" (current-buffer) stderr)
(should (= (point-min) (point-max)))
(should
(string-match
"error:.+not found"
(with-current-buffer stderr (buffer-string)))))
;; Cleanup.
(ignore-errors (kill-buffer stderr))))
;; Test ordinary `async-shell-command'. ;; Test ordinary `async-shell-command'.
(unwind-protect (unwind-protect
(with-temp-buffer (with-temp-buffer
@ -4475,10 +4487,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(while (while
(re-search-forward tramp-display-escape-sequence-regexp nil t) (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil)) (replace-match "" nil nil))
;; There might be a nasty "Process *Async Shell* finished" message.
(goto-char (point-min))
(forward-line)
(narrow-to-region (point-min) (point))
(should (should
(string-equal (string-equal
(format "%s\n" (file-name-nondirectory tmp-name)) (format "%s\n" (file-name-nondirectory tmp-name))
@ -4505,13 +4513,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(while (while
(re-search-forward tramp-display-escape-sequence-regexp nil t) (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil)) (replace-match "" nil nil))
;; There might be a nasty "Process *Async Shell* finished" message. ;; We cannot use `string-equal', because tramp-adb.el
(goto-char (point-min)) ;; echoes also the sent string.
(forward-line)
(narrow-to-region (point-min) (point))
(should (should
(string-equal (string-match
(format "%s\n" (file-name-nondirectory tmp-name)) (format "\\`%s" (regexp-quote (file-name-nondirectory tmp-name)))
(buffer-string)))) (buffer-string))))
;; Cleanup. ;; Cleanup.