summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-06-11 18:14:30 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-06-11 18:14:30 -0400
commit931a2762fd1e43706684f113f4e69ba95f9b3c0d (patch)
tree5f579d702608b2edcc3114d0440407c2109769c5 /lisp
parent5a3eb0c6e482e35a6ed0f51f2c8453ddc5b0fbd5 (diff)
downloademacs-931a2762fd1e43706684f113f4e69ba95f9b3c0d.tar.gz
emacs-931a2762fd1e43706684f113f4e69ba95f9b3c0d.tar.bz2
emacs-931a2762fd1e43706684f113f4e69ba95f9b3c0d.zip
* lisp/vc/vc.el (vc-deduce-fileset): Change error message.
(vc-read-backend): New function. (vc-next-action): Use it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc/vc.el28
2 files changed, 19 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ddb0d0badc2..10d706ad81c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
2013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
+ * vc/vc.el (vc-deduce-fileset): Change error message.
+ (vc-read-backend): New function.
+ (vc-next-action): Use it.
+
* subr.el (function-arity): Remove (mistakenly added) (bug#14590).
* progmodes/prolog.el (prolog-make-keywords-regexp): Remove.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5e1d27c0ea3..0308dd1ebd4 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -115,10 +115,10 @@
;; Return non-nil if FILE is registered in this backend. Both this
;; function as well as `state' should be careful to fail gracefully
;; in the event that the backend executable is absent. It is
-;; preferable that this function's body is autoloaded, that way only
+;; preferable that this function's *body* is autoloaded, that way only
;; calling vc-registered does not cause the backend to be loaded
;; (all the vc-FOO-registered functions are called to try to find
-;; the controlling backend for FILE.
+;; the controlling backend for FILE).
;;
;; * state (file)
;;
@@ -233,6 +233,7 @@
;; The implementation should pass the value of vc-register-switches
;; to the backend command. (Note: in older versions of VC, this
;; command took a single file argument and not a list.)
+;; The REV argument is a historical leftover and is never used.
;;
;; - init-revision (file)
;;
@@ -999,7 +1000,7 @@ current buffer."
nil)
(list (vc-backend-for-registration (buffer-file-name))
(list buffer-file-name))))
- (t (error "No fileset is available here")))))
+ (t (error "File is not under version control")))))
(defun vc-dired-deduce-fileset ()
(let ((backend (vc-responsible-backend default-directory)))
@@ -1041,6 +1042,11 @@ current buffer."
(eq p q)
(and (member p '(edited added removed)) (member q '(edited added removed)))))
+(defun vc-read-backend (prompt)
+ (intern
+ (completing-read prompt (mapcar 'symbol-name vc-handled-backends)
+ nil 'require-match)))
+
;; Here's the major entry point.
;;;###autoload
@@ -1099,8 +1105,9 @@ For old-style locking-based version control systems, like RCS:
((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
(cond
(verbose
- ;; go to a different revision
+ ;; Go to a different revision.
(let* ((revision
+ ;; FIXME: Provide completion.
(read-string "Branch, revision, or backend to move to: "))
(revision-downcase (downcase revision)))
(if (member
@@ -1161,15 +1168,10 @@ For old-style locking-based version control systems, like RCS:
(message "No files remain to be committed")
(if (not verbose)
(vc-checkin ready-for-commit backend)
- (let* ((revision (read-string "New revision or backend: "))
- (revision-downcase (downcase revision)))
- (if (member
- revision-downcase
- (mapcar (lambda (arg) (downcase (symbol-name arg)))
- vc-handled-backends))
- (let ((vsym (intern revision-downcase)))
- (dolist (file files) (vc-transfer-file file vsym)))
- (vc-checkin ready-for-commit backend revision)))))))
+ (let ((new-backend (vc-read-backend "New backend: ")))
+ (if new-backend
+ (dolist (file files)
+ (vc-transfer-file file new-backend))))))))
;; locked by somebody else (locking VCSes only)
((stringp state)
;; In the old days, we computed the revision once and used it on