aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2013-06-11 18:14:30 -0400
committerStefan Monnier2013-06-11 18:14:30 -0400
commit931a2762fd1e43706684f113f4e69ba95f9b3c0d (patch)
tree5f579d702608b2edcc3114d0440407c2109769c5 /lisp
parent5a3eb0c6e482e35a6ed0f51f2c8453ddc5b0fbd5 (diff)
downloademacs-931a2762fd1e43706684f113f4e69ba95f9b3c0d.tar.gz
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 @@
12013-06-11 Stefan Monnier <monnier@iro.umontreal.ca> 12013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * vc/vc.el (vc-deduce-fileset): Change error message.
4 (vc-read-backend): New function.
5 (vc-next-action): Use it.
6
3 * subr.el (function-arity): Remove (mistakenly added) (bug#14590). 7 * subr.el (function-arity): Remove (mistakenly added) (bug#14590).
4 8
5 * progmodes/prolog.el (prolog-make-keywords-regexp): Remove. 9 * 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 @@
115;; Return non-nil if FILE is registered in this backend. Both this 115;; Return non-nil if FILE is registered in this backend. Both this
116;; function as well as `state' should be careful to fail gracefully 116;; function as well as `state' should be careful to fail gracefully
117;; in the event that the backend executable is absent. It is 117;; in the event that the backend executable is absent. It is
118;; preferable that this function's body is autoloaded, that way only 118;; preferable that this function's *body* is autoloaded, that way only
119;; calling vc-registered does not cause the backend to be loaded 119;; calling vc-registered does not cause the backend to be loaded
120;; (all the vc-FOO-registered functions are called to try to find 120;; (all the vc-FOO-registered functions are called to try to find
121;; the controlling backend for FILE. 121;; the controlling backend for FILE).
122;; 122;;
123;; * state (file) 123;; * state (file)
124;; 124;;
@@ -233,6 +233,7 @@
233;; The implementation should pass the value of vc-register-switches 233;; The implementation should pass the value of vc-register-switches
234;; to the backend command. (Note: in older versions of VC, this 234;; to the backend command. (Note: in older versions of VC, this
235;; command took a single file argument and not a list.) 235;; command took a single file argument and not a list.)
236;; The REV argument is a historical leftover and is never used.
236;; 237;;
237;; - init-revision (file) 238;; - init-revision (file)
238;; 239;;
@@ -999,7 +1000,7 @@ current buffer."
999 nil) 1000 nil)
1000 (list (vc-backend-for-registration (buffer-file-name)) 1001 (list (vc-backend-for-registration (buffer-file-name))
1001 (list buffer-file-name)))) 1002 (list buffer-file-name))))
1002 (t (error "No fileset is available here"))))) 1003 (t (error "File is not under version control")))))
1003 1004
1004(defun vc-dired-deduce-fileset () 1005(defun vc-dired-deduce-fileset ()
1005 (let ((backend (vc-responsible-backend default-directory))) 1006 (let ((backend (vc-responsible-backend default-directory)))
@@ -1041,6 +1042,11 @@ current buffer."
1041 (eq p q) 1042 (eq p q)
1042 (and (member p '(edited added removed)) (member q '(edited added removed))))) 1043 (and (member p '(edited added removed)) (member q '(edited added removed)))))
1043 1044
1045(defun vc-read-backend (prompt)
1046 (intern
1047 (completing-read prompt (mapcar 'symbol-name vc-handled-backends)
1048 nil 'require-match)))
1049
1044;; Here's the major entry point. 1050;; Here's the major entry point.
1045 1051
1046;;;###autoload 1052;;;###autoload
@@ -1099,8 +1105,9 @@ For old-style locking-based version control systems, like RCS:
1099 ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) 1105 ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
1100 (cond 1106 (cond
1101 (verbose 1107 (verbose
1102 ;; go to a different revision 1108 ;; Go to a different revision.
1103 (let* ((revision 1109 (let* ((revision
1110 ;; FIXME: Provide completion.
1104 (read-string "Branch, revision, or backend to move to: ")) 1111 (read-string "Branch, revision, or backend to move to: "))
1105 (revision-downcase (downcase revision))) 1112 (revision-downcase (downcase revision)))
1106 (if (member 1113 (if (member
@@ -1161,15 +1168,10 @@ For old-style locking-based version control systems, like RCS:
1161 (message "No files remain to be committed") 1168 (message "No files remain to be committed")
1162 (if (not verbose) 1169 (if (not verbose)
1163 (vc-checkin ready-for-commit backend) 1170 (vc-checkin ready-for-commit backend)
1164 (let* ((revision (read-string "New revision or backend: ")) 1171 (let ((new-backend (vc-read-backend "New backend: ")))
1165 (revision-downcase (downcase revision))) 1172 (if new-backend
1166 (if (member 1173 (dolist (file files)
1167 revision-downcase 1174 (vc-transfer-file file new-backend))))))))
1168 (mapcar (lambda (arg) (downcase (symbol-name arg)))
1169 vc-handled-backends))
1170 (let ((vsym (intern revision-downcase)))
1171 (dolist (file files) (vc-transfer-file file vsym)))
1172 (vc-checkin ready-for-commit backend revision)))))))
1173 ;; locked by somebody else (locking VCSes only) 1175 ;; locked by somebody else (locking VCSes only)
1174 ((stringp state) 1176 ((stringp state)
1175 ;; In the old days, we computed the revision once and used it on 1177 ;; In the old days, we computed the revision once and used it on