From: Michael Albinus Date: Thu, 8 Aug 2019 14:47:29 +0000 (+0200) Subject: Work on Tramp backward compatibility X-Git-Tag: emacs-27.0.90~1667 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f9beb2bfa9cdccde79793ab2ab8b88797b30b9f0;p=emacs.git Work on Tramp backward compatibility * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file) (tramp-smb-handle-rename-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file): Use `tramp-compat-directory-name-p'. --- diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 475f9a2e2b3..2192f7f0252 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -704,7 +704,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (with-tramp-progress-reporter @@ -781,7 +782,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (with-tramp-progress-reporter diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 8cec5871cfc..f10476a7bc6 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -766,7 +766,8 @@ file names." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (if (or (and equal-remote diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index e0fd8e34415..866e7791bf8 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -215,7 +215,8 @@ file names." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (if (or (and t1 (not (tramp-rclone-file-name-p filename))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 54bf2ba773e..6e18e7330c7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1993,7 +1993,8 @@ file names." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (with-tramp-progress-reporter diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 594463d77fd..b619e77a52a 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -589,7 +589,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) (when (and (file-directory-p newname) - (not (directory-name-p newname))) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) ;; We must also flush the cache of the directory, because @@ -1334,7 +1334,8 @@ component is used as the target of the symlink." (if (tramp-tramp-file-p filename) filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (with-tramp-progress-reporter diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 0ec98bb0691..5d5a3f1f75c 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -243,7 +243,8 @@ absolute file names." (with-parsed-tramp-file-name (if t1 filename newname) nil (when (and (not ok-if-already-exists) (file-exists-p newname)) (tramp-error v 'file-already-exists newname)) - (when (and (file-directory-p newname) (not (directory-name-p newname))) + (when (and (file-directory-p newname) + (not (tramp-compat-directory-name-p newname))) (tramp-error v 'file-error "File is a directory %s" newname)) (if (or (and (file-remote-p filename) (not t1))