summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-cvs.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-09-19 13:31:38 +0300
committerEli Zaretskii <eliz@gnu.org>2015-09-19 13:31:38 +0300
commit9ea6c4df441d85be44dadad4fbd57d2c0f3be4f1 (patch)
tree1c933c1e1395c932b867bee0e507125ae577483b /lisp/vc/vc-cvs.el
parentba3495674e8c6c98f2f180908b2af600a2bd3d2e (diff)
downloademacs-9ea6c4df441d85be44dadad4fbd57d2c0f3be4f1.tar.gz
emacs-9ea6c4df441d85be44dadad4fbd57d2c0f3be4f1.tar.bz2
emacs-9ea6c4df441d85be44dadad4fbd57d2c0f3be4f1.zip
Resurrect the ability to specify a revision in vc-next-action
* lisp/vc/vc-bzr.el (vc-bzr-checkin): * lisp/vc/vc-dav.el (vc-dav-checkin): * lisp/vc/vc-git.el (vc-git-checkin): * lisp/vc/vc-hg.el (vc-hg-checkin): * lisp/vc/vc-mtn.el (vc-mtn-checkin): Accept and silently ignore an additional optional argument, the revision to checkin. * lisp/vc/vc-sccs.el (vc-sccs-checkin): * lisp/vc/vc-cvs.el (vc-cvs-checkin): * lisp/vc/vc-rcs.el (vc-rcs-checkin): Allow to optionally specify a revision to checkin. * lisp/vc/vc.el (vc-next-action): Allow to optionally specify the revision when checking in files. See http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00688.html for the details.
Diffstat (limited to 'lisp/vc/vc-cvs.el')
-rw-r--r--lisp/vc/vc-cvs.el48
1 files changed, 17 insertions, 31 deletions
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 73ef42ac7d6..5f5807fb3c6 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -332,38 +332,20 @@ its parents."
(directory-file-name dir))))
(eq dir t)))
-;; vc-cvs-checkin used to take a 'rev' second argument that allowed
-;; checking in onto a specified branch tip rather than the current
-;; default branch, but nothing in the entire rest of VC exercised
-;; this code. Removing it simplifies the backend interface for all
-;; modes.
-;;
-;; Here's the setup code preserved in amber, in case the logic needs
-;; to be broken out into a method someday; (if rev (concat "-r" rev))
-;; used to be part of the switches passed to vc-cvs-command.
-;;
-;; (unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
-;; (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
-;; (error "%s is not a valid symbolic tag name" rev)
-;; ;; If the input revision is a valid symbolic tag name, we create it
-;; ;; as a branch, commit and switch to it.
-;; (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
-;; (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
-;; (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
-;; files)))
-;;
-;; The following postamble cleaned up after the branch change:
-;;
-;; ;; if this was an explicit check-in (does not include creation of
-;; ;; a branch), remove the sticky tag.
-;; (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
-;; (vc-cvs-command nil 0 files "update" "-A"))))
-;; files)))
-;;
-(defun vc-cvs-checkin (files comment)
+(defun vc-cvs-checkin (files comment &optional rev)
"CVS-specific version of `vc-backend-checkin'."
+ (unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
+ (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
+ (error "%s is not a valid symbolic tag name" rev)
+ ;; If the input revision is a valid symbolic tag name, we create it
+ ;; as a branch, commit and switch to it.
+ (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
+ (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
+ (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
+ files)))
(let ((status (apply 'vc-cvs-command nil 1 files
- "ci" (concat "-m" comment)
+ "ci" (if rev (concat "-r" rev))
+ (concat "-m" comment)
(vc-switches 'CVS 'checkin))))
(set-buffer "*vc*")
(goto-char (point-min))
@@ -394,7 +376,11 @@ its parents."
;; tell it from the permissions of the file (see
;; vc-cvs-checkout-model).
(mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
- files)))
+ files)
+ ;; if this was an explicit check-in (does not include creation of
+ ;; a branch), remove the sticky tag.
+ (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
+ (vc-cvs-command nil 0 files "update" "-A"))))
(defun vc-cvs-find-revision (file rev buffer)
(apply 'vc-cvs-command