]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-rcs.el
Resurrect the ability to specify a revision in vc-next-action
[gnu-emacs] / lisp / vc / vc-rcs.el
index 8aedc00269dbdf6bcc0137a8d1297bd71f31d794..ba1336424ea019a9674c279bb73bd96b4764513e 100644 (file)
@@ -76,7 +76,7 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :version "21.1"
   :group 'vc-rcs)
 
-(defcustom vc-rcs-header '("\$Id\$")
+(defcustom vc-rcs-header '("$Id\ $")
   "Header keywords to be inserted by `vc-insert-headers'."
   :type '(repeat string)
   :version "24.1"     ; no longer consult the obsolete vc-header-alist
@@ -243,7 +243,9 @@ to the RCS command."
             ;; if available, use the secure registering option
             (and (vc-rcs-release-p "5.6.4") "-i")
             "-u"
-            (and comment (concat "-t-" comment))
+             ;; Some old MS-Windows ports of RCS crash when "ci -i" is
+             ;; invoked without -t; indulge them.
+            (concat "-t-" (or comment ""))
             (vc-switches 'RCS 'register))
       ;; parse output to find master file name and workfile version
       (with-current-buffer "*vc*"
@@ -304,27 +306,23 @@ whether to remove it."
           (yes-or-no-p (format "Directory %s is empty; remove it? " dir))
           (delete-directory dir)))))
 
-;; It used to be possible to pass in a value for the variable rev, but
-;; nothing in the rest of VC used this capability.  Removing it makes the
-;; backend interface simpler for all modes.
-;;
-(defun vc-rcs-checkin (files comment)
+(defun vc-rcs-checkin (files comment &optional rev)
   "RCS-specific version of `vc-backend-checkin'."
-  (let (rev (switches (vc-switches 'RCS 'checkin)))
+  (let ((switches (vc-switches 'RCS 'checkin)))
     ;; Now operate on the files
     (dolist (file (vc-expand-dirs files 'RCS))
       (let ((old-version (vc-working-revision file)) new-version
            (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
        ;; Force branch creation if an appropriate
        ;; default branch has been set.
-       (and default-branch
+       (and (not rev)
+             default-branch
             (string-match (concat "^" (regexp-quote old-version) "\\.")
                           default-branch)
             (setq rev default-branch)
             (setq switches (cons "-f" switches)))
-       (if old-version
-           (setq rev (vc-branch-part old-version))
-         (error "can't find current branch"))
+       (if (and (not rev) old-version)
+           (setq rev (vc-branch-part old-version)))
        (apply #'vc-do-command "*vc*" 0 "ci" (vc-master-name file)
               ;; if available, use the secure check-in option
               (and (vc-rcs-release-p "5.6.4") "-j")
@@ -758,7 +756,7 @@ Optional arg REVISION is a revision to annotate from."
       (insert (gethash (get-text-property (point) :vc-rcs-r/d/a) ht))
       (forward-line 1))))
 
-(declare-function vc-annotate-convert-time "vc-annotate" (time))
+(declare-function vc-annotate-convert-time "vc-annotate" (&optional time))
 
 (defun vc-rcs-annotate-current-time ()
   "Return the current time, based at midnight of the current day, and
@@ -1116,12 +1114,12 @@ Returns: nil            if no headers were found
 (defun vc-release-greater-or-equal (r1 r2)
   "Compare release numbers, represented as strings.
 Release components are assumed cardinal numbers, not decimal fractions
-\(5.10 is a higher release than 5.9\).  Omitted fields are considered
-lower \(5.6.7 is earlier than 5.6.7.1\).  Comparison runs till the end
+\(5.10 is a higher release than 5.9).  Omitted fields are considered
+lower \(5.6.7 is earlier than 5.6.7.1).  Comparison runs till the end
 of the string is found, or a non-numeric component shows up \(5.6.7 is
 earlier than \"5.6.7 beta\", which is probably not what you want in
-some cases\).  This code is suitable for existing RCS release numbers.
-CVS releases are handled reasonably, too \(1.3 < 1.4* < 1.5\)."
+some cases).  This code is suitable for existing RCS release numbers.
+CVS releases are handled reasonably, too \(1.3 < 1.4* < 1.5)."
   (let (v1 v2 i1 i2)
     (catch 'done
       (or (and (string-match "^\\.?\\([0-9]+\\)" r1)