changeset 66549:13a55a7627fd

(vc-switch-backend): Better error message if the buffer is not visiting a file under version control.
author André Spiegel <spiegel@gnu.org>
date Sun, 30 Oct 2005 10:39:55 +0000
parents 2e58815bc4ab
children b5d0e8180416
files lisp/vc.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Sun Oct 30 07:36:35 2005 +0000
+++ b/lisp/vc.el	Sun Oct 30 10:39:55 2005 +0000
@@ -2596,9 +2596,12 @@
 To get a prompt, use a prefix argument."
   (interactive
    (list
-    buffer-file-name
+    (or buffer-file-name
+        (error "There is no version-controlled file in this buffer"))
     (let ((backend (vc-backend buffer-file-name))
 	  (backends nil))
+      (unless backend
+        (error "File %s is not under version control" buffer-file-name))
       ;; Find the registered backends.
       (dolist (backend vc-handled-backends)
 	(when (vc-call-backend backend 'registered buffer-file-name)