# HG changeset patch # User Katsumi Yamaoka # Date 1263339795 0 # Node ID a30f962075db73b81ed238bbcf597b23d7975e29 # Parent 66202b6a2be32032620016709c57ea69df167e5f# Parent 390461140f6c05a78d51474b1ead7b54c0465ce6 Merge from mainline. diff -r 66202b6a2be3 -r a30f962075db lisp/ChangeLog --- a/lisp/ChangeLog Tue Jan 12 21:54:22 2010 +0000 +++ b/lisp/ChangeLog Tue Jan 12 23:43:15 2010 +0000 @@ -1,3 +1,8 @@ +2010-01-12 Michael Albinus + + * files.el (copy-directory): Compute target for recursive + directories with identical names. (Bug#5343) + 2010-01-12 Glenn Morris * mail/emacsbug.el (report-emacs-bug-pretest-address): Set diff -r 66202b6a2be3 -r a30f962075db lisp/files.el --- a/lisp/files.el Tue Jan 12 21:54:22 2010 +0000 +++ b/lisp/files.el Tue Jan 12 23:43:15 2010 +0000 @@ -4714,20 +4714,17 @@ ;; Compute target name. (setq directory (directory-file-name (expand-file-name directory)) newname (directory-file-name (expand-file-name newname))) - (if (and (file-directory-p newname) - (not (string-equal (file-name-nondirectory directory) - (file-name-nondirectory newname)))) - (setq newname - (expand-file-name (file-name-nondirectory directory) newname))) (if (not (file-directory-p newname)) (make-directory newname parents)) ;; Copy recursively. (mapc (lambda (file) - (if (file-directory-p file) - (copy-directory file newname keep-time parents) - (copy-file file newname t keep-time))) - ;; We do not want to delete "." and "..". + (let ((target (expand-file-name + (file-name-nondirectory file) newname))) + (if (file-directory-p file) + (copy-directory file target keep-time parents) + (copy-file file target t keep-time)))) + ;; We do not want to copy "." and "..". (directory-files directory 'full directory-files-no-dot-files-regexp)) ;; Set directory attributes.