bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15737: 24.3; copy-directory ignores copy-contents when using tramp


From: Michael Albinus
Subject: bug#15737: 24.3; copy-directory ignores copy-contents when using tramp
Date: Mon, 28 Oct 2013 09:23:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Kyle Mahan <address@hidden> writes:

> Hello,

Hi,

> Trying to copy the contents of a local directory to a remote one
> (trying to get behavior like "scp -r src/* address@hidden:dest/") , I
> noticed that the "copy-contents" flag is (silently?) ignored when the
> destination is remote. So the directory, rather than its contents is
> copied to the destination.

Thanks for the report, I could reproduce it here. Could you, please,
check the following patch:

--8<---------------cut here---------------start------------->8---
*** /usr/local/src/emacs-24/lisp/net/tramp-sh.el.~111399~       2013-10-28 
09:18:09.197122236 +0100
--- /usr/local/src/emacs-24/lisp/net/tramp-sh.el        2013-10-28 
09:17:24.648901345 +0100
***************
*** 1912,1918 ****
    (let ((t1 (tramp-tramp-file-p dirname))
        (t2 (tramp-tramp-file-p newname)))
      (with-parsed-tramp-file-name (if t1 dirname newname) nil
!       (if (and (tramp-get-method-parameter method 'tramp-copy-recursive)
               ;; When DIRNAME and NEWNAME are remote, they must have
               ;; the same method.
               (or (null t1) (null t2)
--- 1912,1919 ----
    (let ((t1 (tramp-tramp-file-p dirname))
        (t2 (tramp-tramp-file-p newname)))
      (with-parsed-tramp-file-name (if t1 dirname newname) nil
!       (if (and (not copy-contents)
!              (tramp-get-method-parameter method 'tramp-copy-recursive)
               ;; When DIRNAME and NEWNAME are remote, they must have
               ;; the same method.
               (or (null t1) (null t2)
***************
*** 1935,1941 ****
             'copy dirname newname keep-date))
        ;; We must do it file-wise.
        (tramp-run-real-handler
!        'copy-directory (list dirname newname keep-date parents)))
  
        ;; When newname did exist, we have wrong cached values.
        (when t2
--- 1936,1945 ----
             'copy dirname newname keep-date))
        ;; We must do it file-wise.
        (tramp-run-real-handler
!        'copy-directory
!        (if copy-contents
!            (list dirname newname keep-date parents copy-contents)
!          (list dirname newname keep-date parents))))
  
        ;; When newname did exist, we have wrong cached values.
        (when t2
--8<---------------cut here---------------end--------------->8---

> Thanks :)

Best regards, Michael.





reply via email to

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