[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r112933: * lisp/vc/vc.el (vc-deduce-fileset): Change
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] trunk r112933: * lisp/vc/vc.el (vc-deduce-fileset): Change error message. |
Date: |
Tue, 11 Jun 2013 22:14:37 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112933
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-06-11 18:14:30 -0400
message:
* lisp/vc/vc.el (vc-deduce-fileset): Change error message.
(vc-read-backend): New function.
(vc-next-action): Use it.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/vc/vc.el vc.el-20091113204419-o5vbwnq5f7feedwu-502
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-06-11 21:53:40 +0000
+++ b/lisp/ChangeLog 2013-06-11 22:14:30 +0000
@@ -1,5 +1,9 @@
2013-06-11 Stefan Monnier <address@hidden>
+ * 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.
=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el 2013-04-24 07:52:00 +0000
+++ b/lisp/vc/vc.el 2013-06-11 22:14:30 +0000
@@ -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 @@
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 @@
(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 @@
((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 @@
(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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r112933: * lisp/vc/vc.el (vc-deduce-fileset): Change error message.,
Stefan Monnier <=