[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1ab3b48 43/92: Implemented file copying
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 1ab3b48 43/92: Implemented file copying |
Date: |
Thu, 11 Jun 2015 19:48:04 +0000 |
branch: master
commit 1ab3b48b1045c06999953db4c669288a7d138c27
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Implemented file copying
---
ztree-diff.el | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/ztree-diff.el b/ztree-diff.el
index 50c8b7c..00e9067 100644
--- a/ztree-diff.el
+++ b/ztree-diff.el
@@ -165,8 +165,30 @@ including . and ..")
(ztree-diff-node-short-name node)
(if copy-to-right "RIGHT" "LEFT")
destination-path)))
- nil ; do copy
- ))))))
+ (if (file-directory-p source-path)
+ nil ; TODO: implement directory copy
+ (let ((target-path (concat
+ (file-name-as-directory destination-path)
+ (file-name-nondirectory
+ (directory-file-name source-path)))))
+ (let ((err (condition-case error-trap
+ (progn
+ ;; ask for overwrite
+ ;; keep time stamp
+ (copy-file source-path target-path 1 t)
+ nil)
+ (error error-trap))))
+ ;; error message if failed
+ (if err (message (concat "Error: " (nth 2 err)))
+ (progn ; otherwise:
+ ;; assuming all went ok when left and right nodes are
the same
+ ;; set both as not different
+ (ztree-diff-node-set-different node nil)
+ ;; update left/right paths
+ (if copy-to-right
+ (ztree-diff-node-set-right-path node target-path)
+ (ztree-diff-node-set-left-path node target-path))
+ (ztree-refresh-buffer (line-number-at-pos)))))))))))))
(defun ztree-diff (dir1 dir2)
- [elpa] master 413cff4 30/92: Drawing trees only to visible items, (continued)
- [elpa] master 413cff4 30/92: Drawing trees only to visible items, Alexey Veretennikov, 2015/06/11
- [elpa] master 161b1b3 35/92: Added messages, Alexey Veretennikov, 2015/06/11
- [elpa] master 9b91d44 31/92: Implemented colors support for different files, Alexey Veretennikov, 2015/06/11
- [elpa] master 44743c1 37/92: Added progress indication to the diff model, Alexey Veretennikov, 2015/06/11
- [elpa] master 99a0cf7 36/92: Started work for identifying parents in nodes, Alexey Veretennikov, 2015/06/11
- [elpa] master 291a115 32/92: Header is now customizable, Alexey Veretennikov, 2015/06/11
- [elpa] master f9620df 34/92: Added action on modified files, Alexey Veretennikov, 2015/06/11
- [elpa] master 900c8fa 38/92: Refactored using defrecord macro, Alexey Veretennikov, 2015/06/11
- [elpa] master 6154ab8 21/92: Split view and models - for directory tree and for diff tree, Alexey Veretennikov, 2015/06/11
- [elpa] master 8335785 39/92: Added comment, Alexey Veretennikov, 2015/06/11
- [elpa] master 1ab3b48 43/92: Implemented file copying,
Alexey Veretennikov <=
- [elpa] master af28a78 41/92: Started implementation of the copy functionality, Alexey Veretennikov, 2015/06/11
- [elpa] master 75b89a6 48/92: Fixed typo, Alexey Veretennikov, 2015/06/11
- [elpa] master 725f388 42/92: Preparation to copy implementation done, Alexey Veretennikov, 2015/06/11
- [elpa] master f78b859 47/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 20d8217 44/92: Implemented directory copying, Alexey Veretennikov, 2015/06/11
- [elpa] master d590f88 40/92: Added minor mode for ztree diff, to create custom keybindings, Alexey Veretennikov, 2015/06/11
- [elpa] master 81b6a4b 49/92: Added delete functionality, Alexey Veretennikov, 2015/06/11
- [elpa] master c3580db 46/92: Updated readme; renamed the ztree to ztree-dir, Alexey Veretennikov, 2015/06/11
- [elpa] master 3867ed3 45/92: Implemented support for hiding matched(equal) files, Alexey Veretennikov, 2015/06/11
- [elpa] master 15baed9 50/92: Repaired full rescan; added 'v' keybinding to quickly view files, Alexey Veretennikov, 2015/06/11