[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`tramp-handle-vc-registered' is problematic
From: |
Toru TSUNEYOSHI |
Subject: |
`tramp-handle-vc-registered' is problematic |
Date: |
Tue, 10 Aug 2010 12:18:30 +0900 (JST) |
Hello.
I think that function `tramp-handle-vc-registered' is problematic.
The reason is that COMMAND
(mapconcat 'tramp-shell-quote-argument
tramp-vc-registered-file-names
" ")
of `tramp-send-command-and-read' become too long (>= 4096 characters)
easily. Indeed, `tramp-send-command-and-read' hangs up often.
(I use "pscp" as the method.)
========================================================================
(defun tramp-handle-vc-registered (file)
...
;; 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
(tramp-send-command-and-read ;; <=
v ;; <=
(format ;; <=
"tramp_vc_registered_read_file_names %s" ;; <=
(mapconcat 'tramp-shell-quote-argument ;; <=
tramp-vc-registered-file-names ;; <=
" ")))) ;; <=
(tramp-set-file-property
v (car elt) (cadr elt) (cadr (cdr elt))))))
...
)
========================================================================
Please fix it.
(I fixed it temporarily.)
========================================================================
--- tramp.el.original 2010-08-10 09:40:05.772650400 +0900
+++ tramp.el 2010-08-10 12:02:46.873587600 +0900
@@ -5414,18 +5414,18 @@
(format "%s -r" (tramp-get-test-command v)))
"tramp_vc_registered_read_file_names")
- (dolist
- (elt
- (tramp-send-command-and-read
- v
- (format
- "tramp_vc_registered_read_file_names %s"
- (mapconcat 'tramp-shell-quote-argument
- tramp-vc-registered-file-names
- " "))))
+ (mapc
+ (lambda (x)
+ (dolist
+ (elt
+ (tramp-send-command-and-read
+ v
+ (format
+ "tramp_vc_registered_read_file_names %s"
+ (tramp-shell-quote-argument x))))
- (tramp-set-file-property
- v (car elt) (cadr elt) (cadr (cdr elt))))))
+ (tramp-set-file-property v (car elt) (cadr elt) (cadr (cdr
elt)))))
+ tramp-vc-registered-file-names)))
;; Second run. Now all `file-exists-p' or `file-readable-p'
;; calls shall be answered from the file cache. We unset
========================================================================
- `tramp-handle-vc-registered' is problematic,
Toru TSUNEYOSHI <=