commit 19fbef549a94ccf733367d29438204e94a00e911 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Wed Feb 6 09:07:39 2019 +0100 Fix Bug#34196 * lisp/autorevert.el (auto-revert-buffers): Handle buffers with a remote default-directory only, when they are connected. (Bug#34196) * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection): Set "connected" property. * lisp/net/tramp.el (tramp-process-actions): Revert change from 2019-02-04. Bug#34196 will be solved in autorevert.el. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 16a742a458..150693baf1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -767,6 +767,16 @@ the timer when no buffers need to be checked." (buffer-list) auto-revert-buffer-list)) remaining new) + ;; Buffers with remote contents shall be reverted only if the + ;; connection is established already. + (setq bufs (delq nil + (mapcar + (lambda (buf) + (with-current-buffer buf + (and (or (not (file-remote-p default-directory)) + (file-remote-p default-directory nil t)) + buf))) + bufs))) ;; Partition `bufs' into two halves depending on whether or not ;; the buffers are in `auto-revert-remaining-buffers'. The two ;; halves are then re-joined with the "remaining" buffers at the diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 48adea0689..3a0e002bc6 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -568,7 +568,11 @@ connection if a previous connection has died for some reason." ;; This could be nil. ,(tramp-get-method-parameter vec 'tramp-mount-args)))) (while (not (file-exists-p (tramp-make-tramp-file-name vec 'localname))) - (tramp-cleanup-connection vec 'keep-debug 'keep-password))))) + (tramp-cleanup-connection vec 'keep-debug 'keep-password)) + + ;; Mark it as connected. + (tramp-set-connection-property + (tramp-get-connection-process vec) "connected" t)))) ;; In `tramp-check-cached-permissions', the connection properties ;; "{uid,gid}-{integer,string}" are used. We set them to proper values. diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 80c63c16ed..04b0bebabd 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -785,7 +785,10 @@ connection if a previous connection has died for some reason." (set-process-query-on-exit-flag p nil) ;; Set connection-local variables. - (tramp-set-connection-local-variables vec)) + (tramp-set-connection-local-variables vec) + + ;; Mark it as connected. + (tramp-set-connection-property p "connected" t)) ;; In `tramp-check-cached-permissions', the connection properties ;; "{uid,gid}-{integer,string}" are used. We set them to proper values. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 82d2e5a4d3..d000bbe3d6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4060,23 +4060,17 @@ performed successfully. Any other value means an error." (save-restriction (with-tramp-progress-reporter proc 3 "Waiting for prompts from remote shell" - ;; `global-auto-revert-mode' could activate remote operations - ;; while we aren't ready. We disable it temporarily. - (let ((garm (bound-and-true-p global-auto-revert-mode)) - exit) - (when garm (global-auto-revert-mode -1)) - (unwind-protect - (if timeout - (with-timeout (timeout (setq exit 'timeout)) - (while (not exit) - (setq exit - (catch 'tramp-action - (tramp-process-one-action proc vec actions))))) + (let (exit) + (if timeout + (with-timeout (timeout (setq exit 'timeout)) (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) - (when garm (global-auto-revert-mode))) + (while (not exit) + (setq exit + (catch 'tramp-action + (tramp-process-one-action proc vec actions))))) (with-current-buffer (tramp-get-connection-buffer vec) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) commit d087dcf140ed1dafff4d64aee75d8becc621b848 Author: Robert Pluim Date: Tue Feb 5 13:47:27 2019 +0100 Fix network stream tests * test/lisp/net/network-stream-tests.el (make-ipv6-tcp-server-with-unspecified-port): Skip if IPv6 is not available. (make-ipv6-tcp-server-with-specified-port): Likewise. (echo-server-with-local-ipv6): Likewise. diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index 6151c3064c..b85746a312 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -72,28 +72,34 @@ (delete-process server))) (ert-deftest make-ipv6-tcp-server-with-unspecified-port () + (skip-unless (featurep 'make-network-process '(:family ipv6))) (let ((server - (make-network-process - :name "server" - :server t - :noquery t - :family 'ipv6 - :service t - :host 'local))) + (ignore-errors + (make-network-process + :name "server" + :server t + :noquery t + :family 'ipv6 + :service t + :host 'local)))) + (skip-unless server) (should (and (arrayp (process-contact server :local)) (numberp (aref (process-contact server :local) 8)) (> (aref (process-contact server :local) 8) 0))) (delete-process server))) (ert-deftest make-ipv6-tcp-server-with-specified-port () + (skip-unless (featurep 'make-network-process '(:family ipv6))) (let ((server - (make-network-process - :name "server" - :server t - :noquery t - :family 'ipv6 - :service 57870 - :host 'local))) + (ignore-errors + (make-network-process + :name "server" + :server t + :noquery t + :family 'ipv6 + :service 57870 + :host 'local)))) + (skip-unless server) (should (and (arrayp (process-contact server :local)) (= (aref (process-contact server :local) 8) 57870))) (delete-process server))) @@ -171,18 +177,20 @@ (delete-process server))) (ert-deftest echo-server-with-local-ipv6 () - (let* ((server (make-server 'local 'ipv6)) - (port (aref (process-contact server :local) 8)) - (proc (make-network-process :name "foo" - :buffer (generate-new-buffer "*foo*") - :host 'local - :family 'ipv6 - :service port))) - (with-current-buffer (process-buffer proc) - (process-send-string proc "echo foo") - (sleep-for 0.1) - (should (equal (buffer-string) "foo\n"))) - (delete-process server))) + (skip-unless (featurep 'make-network-process '(:family ipv6))) + (let ((server (ignore-errors (make-server 'local 'ipv6)))) + (skip-unless server) + (let* ((port (aref (process-contact server :local) 8)) + (proc (make-network-process :name "foo" + :buffer (generate-new-buffer "*foo*") + :host 'local + :family 'ipv6 + :service port))) + (with-current-buffer (process-buffer proc) + (process-send-string proc "echo foo") + (sleep-for 0.1) + (should (equal (buffer-string) "foo\n"))) + (delete-process server)))) (ert-deftest echo-server-with-ip () (let* ((server (make-server 'local))