Toru TSUNEYOSHI <[email protected]> writes:
> Hello.
Hi,
> 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 see.
> Please fix it.
Could you, please, check the appended patch? (You might need to restart
Emacs, because a defconst has been changed)
--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~2.811~ 2010-08-10
10:09:52.830260555 +0200
--- /home/albinus/src/tramp/lisp/tramp.el 2010-08-10 10:04:39.000000000
+0200
***************
*** 1983,1995 ****
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
! for file in \"$...@\"; do
! if %s $file; then
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\"
fi
! if %s $file; then
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\"
--- 1983,1995 ----
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
! while read file; do
! if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\"
fi
! if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\"
***************
*** 1998,2004 ****
echo \")\""
"Script to check existence of VC related files.
It must be send formatted with two strings; the tests for file
! existence, and file readability.")
(defconst tramp-file-mode-type-map
'((0 . "-") ; Normal file (SVID-v2 and XPG2)
--- 1998,2006 ----
echo \")\""
"Script to check existence of VC related files.
It must be send formatted with two strings; the tests for file
! existence, and file readability. Input shall be read via
! here-document, otherwise the command could exceed maximum length
! of command line.")
(defconst tramp-file-mode-type-map
'((0 . "-") ; Normal file (SVID-v2 and XPG2)
***************
*** 5419,5428 ****
(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))))))
--- 5421,5430 ----
(tramp-send-command-and-read
v
(format
! "tramp_vc_registered_read_file_names <<'EOF'\n%s\nEOF\n"
(mapconcat 'tramp-shell-quote-argument
tramp-vc-registered-file-names
! "\n"))))
(tramp-set-file-property
v (car elt) (cadr elt) (cadr (cdr elt))))))
--8<---------------cut here---------------end--------------->8---
Thanks for the report, and best regards, Michael.
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel