[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 828aca3 022/173: Local path and local root i
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 828aca3 022/173: Local path and local root is now evaluated based on their truenames. |
Date: |
Sat, 20 Oct 2018 10:36:23 -0400 (EDT) |
branch: externals/ssh-deploy
commit 828aca3ad1393cf529790fe5946a2dddb2383428
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Local path and local root is now evaluated based on their truenames.
---
README.md | 9 ++++-----
ssh-deploy.el | 32 +++++++++++++++++++++++---------
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index fe13e4e..2dcab9d 100644
--- a/README.md
+++ b/README.md
@@ -39,16 +39,15 @@ This application is made by Christian Johansson
<address@hidden> 2016 and is l
You can remove the `add-to-list` line if you installed via `MELPA` repository.
* Now when you save a file somewhere under the directory
`/Users/username/Web/MySite/`, the script will launch and deploy the file with
the remote server.
-* If you press `C-c C-z x` and the current buffer is a file, you will launch a
`ediff` session showing differences between local file and remote file using
`tramp`, or if current buffer is a directory it will show differences with
remote directory using `ztree-diff` using `tramp`.
+* If you press `C-c C-z x` and the current buffer is a file, you will launch a
`ediff` session showing differences between local file and remote file via
`tramp`, or if current buffer is a directory it will show differences with
remote directory using `ztree-diff` via `tramp`.
* If you press `C-c C-z u` you will upload local file or directory to remote
host.
* If you press `C-c C-z d` you will download the current file or directory
from remote host and then reload current buffer.
-* If you press `C-c C-z t` you will open a terminal with remote host.
+* If you press `C-c C-z t` you will open a terminal with remote host via
`tramp-term`.
* If you press `C-c C-z b` you will browse current directory on remote host in
`dired-mode`.
-The above configuration uses the plugin `use-package` which I highly recommend.
+The local path and local root is evaluated based on it's *truename* so if you
use different symbolic local paths it shouldn't affect the deployment procedure.
-## TODO
-* Add notification for remote changes of files
+The above configuration uses the plugin `use-package` which I highly recommend.
## Read more
* <https://www.emacswiki.org/emacs/DirectoryVariables>
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 64b06bc..783be76 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -89,8 +89,8 @@
(defun ssh-deploy-remote-terminal (remote-host)
"Opens REMOTE-HOST in tramp terminal."
(if (and (fboundp 'tramp-term)
- (fboundp 'tramp-term--initialize)
- (fboundp 'tramp-term--do-ssh-login))
+ (fboundp 'tramp-term--initialize)
+ (fboundp 'tramp-term--do-ssh-login))
(progn
(let ((hostname (replace-regexp-in-string ":.*$" "" remote-host)))
(let ((host (split-string hostname "@")))
@@ -183,27 +183,39 @@
"Upload current path to remote host if it is configured for SSH deployment."
(if (and (ssh-deploy-is-not-empty-string ssh-deploy-root-local)
(ssh-deploy-is-not-empty-string ssh-deploy-root-remote))
(if (ssh-deploy-is-not-empty-string buffer-file-name)
- (ssh-deploy ssh-deploy-root-local ssh-deploy-root-remote t
buffer-file-name)
+ (let ((local-path (file-truename buffer-file-name))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy local-root ssh-deploy-root-remote t local-path))
(if (ssh-deploy-is-not-empty-string default-directory)
- (ssh-deploy ssh-deploy-root-local ssh-deploy-root-remote t
(expand-file-name default-directory))))))
+ (let ((local-path (file-truename default-directory))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy local-root ssh-deploy-root-remote t local-path))))))
;;;### autoload
(defun ssh-deploy-download-handler ()
"Download current path from remote host if it is configured for SSH
deployment."
(if (and (ssh-deploy-is-not-empty-string ssh-deploy-root-local)
(ssh-deploy-is-not-empty-string ssh-deploy-root-remote))
(if (ssh-deploy-is-not-empty-string buffer-file-name)
- (ssh-deploy ssh-deploy-root-local ssh-deploy-root-remote nil
buffer-file-name)
+ (let ((local-path (file-truename buffer-file-name))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy local-root ssh-deploy-root-remote nil local-path))
(if (ssh-deploy-is-not-empty-string default-directory)
- (ssh-deploy ssh-deploy-root-local ssh-deploy-root-remote nil
(expand-file-name default-directory))))))
+ (let ((local-path (file-truename default-directory))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy local-root ssh-deploy-root-remote nil local-path))))))
;;;### autoload
(defun ssh-deploy-diff-handler ()
"Compare current path with remote host if it is configured for SSH
deployment."
(if (and (ssh-deploy-is-not-empty-string ssh-deploy-root-local)
(ssh-deploy-is-not-empty-string ssh-deploy-root-remote))
(if (ssh-deploy-is-not-empty-string buffer-file-name)
- (ssh-deploy-diff ssh-deploy-root-local ssh-deploy-root-remote
buffer-file-name)
+ (let ((local-path (file-truename buffer-file-name))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy-diff local-root ssh-deploy-root-remote local-path))
(if (ssh-deploy-is-not-empty-string default-directory)
- (ssh-deploy-diff ssh-deploy-root-local ssh-deploy-root-remote
(expand-file-name default-directory))))))
+ (let ((local-path (file-truename default-directory))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy-diff local-root ssh-deploy-root-remote
local-path))))))
;;;### autoload
(defun ssh-deploy-remote-terminal-handler ()
@@ -215,7 +227,9 @@
(defun ssh-deploy-browse-remote-handler ()
"Open current relative path on remote host in `dired-mode' if it is
configured for SSH deployment."
(if (and (ssh-deploy-is-not-empty-string ssh-deploy-root-local)
(ssh-deploy-is-not-empty-string ssh-deploy-root-remote)
(ssh-deploy-is-not-empty-string default-directory))
- (ssh-deploy-browse-remote ssh-deploy-root-local ssh-deploy-root-remote
default-directory)))
+ (let ((local-path (file-truename default-directory))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy-browse-remote local-root ssh-deploy-root-remote
local-path))))
(provide 'ssh-deploy)
;;; ssh-deploy.el ends here
- [elpa] externals/ssh-deploy d599659 015/173: Added support for opening remote terminals, uploads/downloads/differences of directories, browsing remote hosts and fixed a bug where paths with special chars were not handled correctly., (continued)
- [elpa] externals/ssh-deploy d599659 015/173: Added support for opening remote terminals, uploads/downloads/differences of directories, browsing remote hosts and fixed a bug where paths with special chars were not handled correctly., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 1af0208 045/173: Cleaned up code structure and isolated functions, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 740c27d 054/173: Fixed message when no base revision exists and remote file equals local file, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy ac7aff8 052/173: Asynchronous detection of remote changes doesn't use any synchronous action, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy d4953c7 049/173: Fixed upload/download of root directory with different names, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 2d2c380 033/173: Implemented FTP via cURL but haven't tested it yet., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy f36ffce 059/173: Added MELPA Stable link, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 29cf0b2 061/173: Added force handler in documentation, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 3ea14de 062/173: Improved README for forced uploads, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a1ea2c2 025/173: Improved description of complex connections, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 828aca3 022/173: Local path and local root is now evaluated based on their truenames.,
Stefan Monnier <=
- [elpa] externals/ssh-deploy d40d817 027/173: Now displaying asynchrous process output., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy be5451c 019/173: Updated to comments and README, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 78d0641 031/173: Updated version and modification date., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy e94c9e7 035/173: Updated title of README.md, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 959aa79 036/173: Fixed a log message., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy f0eb826 030/173: Fixed a bug in protocol definition and started with support for multiple protocols., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 4e70a41 041/173: Now uses TRAMP via async.el for SSH transfers, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8253251 044/173: Improved README a bit, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 94fc9e6 051/173: Updated readme, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 56da852 066/173: Fixed bug where plug-in reported external changes even though remote, Stefan Monnier, 2018/10/20