diff options
author | Juri Linkov <juri@linkov.net> | 2019-11-07 01:14:58 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2019-11-07 01:14:58 +0200 |
commit | deb61da7a27698ddc0b95ba92d18c20f533bb802 (patch) | |
tree | 2309fc8637f80d5ba4607f8a5527555e860248d0 /lisp/vc/vc.el | |
parent | 528485d0172f00e5f0c8ea548013a49964be501b (diff) | |
download | emacs-deb61da7a27698ddc0b95ba92d18c20f533bb802.tar.gz emacs-deb61da7a27698ddc0b95ba92d18c20f533bb802.tar.bz2 emacs-deb61da7a27698ddc0b95ba92d18c20f533bb802.zip |
* lisp/dired-aux.el (dired-vc-rename-file): New defcustom.
(dired-rename-file): Call vc-rename-file when dired-vc-rename-file is non-nil.
* lisp/vc/vc.el (vc-rename-file): Allow renaming added files.
Call vc-file-clearprops on new file too for the case when
old and new files were renamed to each other back and forth.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00069.html
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r-- | lisp/vc/vc.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c982b0220e3..20056dec7f9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2913,11 +2913,12 @@ current buffer's file name if it's under version control." (when (file-exists-p new) (error "New file already exists")) (let ((state (vc-state old))) - (unless (memq state '(up-to-date edited)) + (unless (memq state '(up-to-date edited added)) (error "Please %s files before moving them" (if (stringp state) "check in" "update")))) (vc-call rename-file old new) (vc-file-clearprops old) + (vc-file-clearprops new) ;; Move the actual file (unless the backend did it already) (when (file-exists-p old) (rename-file old new)) ;; ?? Renaming a file might change its contents due to keyword expansion. |