From: Michael Albinus Date: Tue, 21 Apr 2020 11:33:24 +0000 (+0200) Subject: Fix recently introduced error in `tramp-sh-handle-vc-registered' X-Git-Tag: emacs-28.0.90~7533 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f212daf0a96999b8c1e63217c22a86d6e1671687;p=emacs.git Fix recently introduced error in `tramp-sh-handle-vc-registered' * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Improve test for `vc-handled-backends'. (Bug#40670) --- diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 95425cbebc5..a39d503e22b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3577,33 +3577,30 @@ STDERR can also be a file name." ;; calls shall be answered from the file cache. We unset ;; `process-file-side-effects' and `remote-file-name-inhibit-cache' ;; in order to keep the cache. - (let ((vc-handled-backends vc-handled-backends) + (let ((vc-handled-backends (copy-sequence vc-handled-backends)) remote-file-name-inhibit-cache process-file-side-effects) ;; Reduce `vc-handled-backends' in order to minimize ;; process calls. (when (and (memq 'Bzr vc-handled-backends) - (not (and - (bound-and-true-p vc-bzr-program) - (with-tramp-connection-property v vc-bzr-program - (tramp-find-executable - v vc-bzr-program (tramp-get-remote-path v)))))) + (or (not (require 'vc-bzr nil 'noerror)) + (not (with-tramp-connection-property v vc-bzr-program + (tramp-find-executable + v vc-bzr-program (tramp-get-remote-path v)))))) (setq vc-handled-backends (remq 'Bzr vc-handled-backends))) (when (and (memq 'Git vc-handled-backends) - (not (and - (bound-and-true-p vc-git-program) - (with-tramp-connection-property v vc-git-program - (tramp-find-executable - v vc-git-program (tramp-get-remote-path v)))))) + (or (not (require 'vc-git nil 'noerror)) + (not (with-tramp-connection-property v vc-git-program + (tramp-find-executable + v vc-git-program (tramp-get-remote-path v)))))) (setq vc-handled-backends (remq 'Git vc-handled-backends))) (when (and (memq 'Hg vc-handled-backends) - (not (and - (bound-and-true-p vc-hg-program) - (with-tramp-connection-property v vc-hg-program - (tramp-find-executable - v vc-hg-program (tramp-get-remote-path v)))))) + (or (not (require 'vc-hg nil 'noerror)) + (not (with-tramp-connection-property v vc-hg-program + (tramp-find-executable + v vc-hg-program (tramp-get-remote-path v)))))) (setq vc-handled-backends (remq 'Hg vc-handled-backends))) ;; Run. (tramp-with-demoted-errors