emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116693: * net/tramp-sh.el (tramp-sh-handle-vc-regis


From: Michael Albinus
Subject: [Emacs-diffs] trunk r116693: * net/tramp-sh.el (tramp-sh-handle-vc-registered): Run first pass
Date: Fri, 07 Mar 2014 14:07:21 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116693
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2014-03-07 15:07:12 +0100
message:
  * net/tramp-sh.el (tramp-sh-handle-vc-registered): Run first pass
  only when `remote-file-name-inhibit-cache' is nil.
  (tramp-sh-file-name-handler): Use `tramp-error'.  Simplify code.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-07 00:01:19 +0000
+++ b/lisp/ChangeLog    2014-03-07 14:07:12 +0000
@@ -1,3 +1,9 @@
+2014-03-07  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-sh-handle-vc-registered): Run first pass
+       only when `remote-file-name-inhibit-cache' is nil.
+       (tramp-sh-file-name-handler): Use `tramp-error'.  Simplify code.
+
 2014-03-06  Martin Rudalics  <address@hidden>
 
        * window.el (fit-frame-to-buffer, fit-frame-to-buffer-margins):

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-03-04 14:40:38 +0000
+++ b/lisp/net/tramp-sh.el      2014-03-07 14:07:12 +0000
@@ -3306,48 +3306,49 @@
       (with-tramp-progress-reporter
          v 3 (format "Checking `vc-registered' for %s" file)
 
-       ;; There could be new files, created by the vc backend.  We
-       ;; cannot reuse the old cache entries, therefore.
-       (let (tramp-vc-registered-file-names
-             (remote-file-name-inhibit-cache (current-time))
-             (file-name-handler-alist
-              `((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
-
-         ;; Here we collect only file names, which need an operation.
-         (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
-         (tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
-
-         ;; Send just one command, in order to fill the cache.
-         (when tramp-vc-registered-file-names
-           (tramp-maybe-send-script
-            v
-            (format tramp-vc-registered-read-file-names
-                    (tramp-get-file-exists-command v)
-                    (format "%s -r" (tramp-get-test-command v)))
-            "tramp_vc_registered_read_file_names")
-
-           (dolist
-               (elt
-                (ignore-errors
-                  ;; We cannot use `tramp-send-command-and-read',
-                  ;; because this does not cooperate well with
-                  ;; heredoc documents.
-                  (tramp-send-command
-                   v
-                   (format
-                    "tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n"
-                    tramp-end-of-heredoc
-                    (mapconcat 'tramp-shell-quote-argument
-                               tramp-vc-registered-file-names
-                               "\n")
-                    tramp-end-of-heredoc))
-                  (with-current-buffer (tramp-get-connection-buffer v)
-                    ;; Read the expression.
-                    (goto-char (point-min))
-                    (read (current-buffer)))))
-
-             (tramp-set-file-property
-              v (car elt) (cadr elt) (cadr (cdr elt))))))
+       (unless remote-file-name-inhibit-cache
+         ;; There could be new files, created by the vc backend.  We
+         ;; cannot reuse the old cache entries, therefore.
+         (let (tramp-vc-registered-file-names
+               (remote-file-name-inhibit-cache (current-time))
+               (file-name-handler-alist
+                `((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
+
+           ;; Here we collect only file names, which need an operation.
+           (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
+           (tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
+
+           ;; Send just one command, in order to fill the cache.
+           (when tramp-vc-registered-file-names
+             (tramp-maybe-send-script
+              v
+              (format tramp-vc-registered-read-file-names
+                      (tramp-get-file-exists-command v)
+                      (format "%s -r" (tramp-get-test-command v)))
+              "tramp_vc_registered_read_file_names")
+
+             (dolist
+                 (elt
+                  (ignore-errors
+                    ;; We cannot use `tramp-send-command-and-read',
+                    ;; because this does not cooperate well with
+                    ;; heredoc documents.
+                    (tramp-send-command
+                     v
+                     (format
+                      "tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n"
+                      tramp-end-of-heredoc
+                      (mapconcat 'tramp-shell-quote-argument
+                                 tramp-vc-registered-file-names
+                                 "\n")
+                      tramp-end-of-heredoc))
+                    (with-current-buffer (tramp-get-connection-buffer v)
+                      ;; Read the expression.
+                      (goto-char (point-min))
+                      (read (current-buffer)))))
+
+               (tramp-set-file-property
+                v (car elt) (cadr elt) (cadr (cdr elt)))))))
 
        ;; Second run.  Now all `file-exists-p' or `file-readable-p'
        ;; calls shall be answered from the file cache.  We unset
@@ -3363,17 +3364,18 @@
 Fall back to normal file name handler if no Tramp handler exists."
   (when (and tramp-locked (not tramp-locker))
     (setq tramp-locked nil)
-    (signal 'file-error (list "Forbidden reentrant call of Tramp")))
+    (tramp-error
+     (car-safe tramp-current-connection) 'file-error
+     "Forbidden reentrant call of Tramp"))
   (let ((tl tramp-locked))
+    (setq tramp-locked t)
     (unwind-protect
-       (progn
-         (setq tramp-locked t)
-         (let ((tramp-locker t))
-           (save-match-data
-             (let ((fn (assoc operation tramp-sh-file-name-handler-alist)))
-               (if fn
-                   (apply (cdr fn) args)
-                 (tramp-run-real-handler operation args))))))
+       (let ((tramp-locker t))
+         (save-match-data
+           (let ((fn (assoc operation tramp-sh-file-name-handler-alist)))
+             (if fn
+                 (apply (cdr fn) args)
+               (tramp-run-real-handler operation args)))))
       (setq tramp-locked tl))))
 
 (defun tramp-vc-file-name-handler (operation &rest args)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]