summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index bebbf92c632..ec712eee925 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -500,8 +500,12 @@ lock steals will raise an error.
(defun vc-register (&optional override comment)
"Register the current file into your version-control system."
(interactive "P")
- (if (vc-name buffer-file-name)
- (error "This file is already registered"))
+ (let ((master (vc-name buffer-file-name)))
+ (and master (file-exists-p master)
+ (error "This file is already registered"))
+ (and master
+ (not (y-or-n-p "Previous master file has vanished. Make a new one? "))
+ (error "This file is already registered")))
;; Watch out for new buffers of size 0: the corresponding file
;; does not exist yet, even though buffer-modified-p is nil.
(if (and (not (buffer-modified-p))