]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-rcs.el
(cyrillic-koi8-t): Alias of koi8-t.
[gnu-emacs] / lisp / vc-rcs.el
index ea113275bd9b5d6ab1ed75ad41e9b2f162c31c6a..db609eae420403fb28de721204d3196559b7fd37 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-rcs.el,v 1.33 2002/12/26 14:38:20 spiegel Exp $
+;; $Id: vc-rcs.el,v 1.36 2003/02/04 12:11:40 lektu Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -143,9 +143,9 @@ For a description of possible values, see `vc-check-master-templates'."
               (cond
                ((string-match ".rw..-..-." (nth 8 (file-attributes file)))
                 (vc-file-setprop file 'vc-checkout-model 'implicit)
-               (setq state 
-                     (if (vc-rcs-workfile-is-newer file) 
-                         'edited 
+               (setq state
+                     (if (vc-rcs-workfile-is-newer file)
+                         'edited
                        'up-to-date)))
                ((string-match ".r-..-..-." (nth 8 (file-attributes file)))
                 (vc-file-setprop file 'vc-checkout-model 'locking))))
@@ -162,7 +162,7 @@ For a description of possible values, see `vc-check-master-templates'."
                       (if (file-ownership-preserved-p file)
                           'edited
                         (vc-user-login-name owner-uid))
-                    (if (vc-rcs-workfile-is-newer file) 
+                    (if (vc-rcs-workfile-is-newer file)
                         'edited
                       'up-to-date)))
                   (t
@@ -235,15 +235,7 @@ the RCS command (in that order).
 
 Automatically retrieve a read-only version of the file with keywords
 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
-    (let ((subdir (expand-file-name "RCS" (file-name-directory file)))
-         (switches (append
-                    (if (stringp vc-register-switches)
-                        (list vc-register-switches)
-                      vc-register-switches)
-                    (if (stringp vc-rcs-register-switches)
-                    (list vc-rcs-register-switches)
-                    vc-rcs-register-switches))))
-      
+    (let ((subdir (expand-file-name "RCS" (file-name-directory file))))
       (and (not (file-exists-p subdir))
           (not (directory-files (file-name-directory file)
                                 nil ".*,v$" t))
@@ -254,7 +246,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
             (and (vc-rcs-release-p "5.6.4") "-i")
             (concat (if vc-keep-workfiles "-u" "-r") rev)
             (and comment (concat "-t-" comment))
-            switches)
+            (vc-switches 'RCS 'register))
       ;; parse output to find master file name and workfile version
       (with-current-buffer "*vc*"
         (goto-char (point-min))
@@ -305,19 +297,17 @@ whether to remove it."
     (and (string= (file-name-nondirectory (directory-file-name dir)) "RCS")
         ;; check whether RCS dir is empty, i.e. it does not
         ;; contain any files except "." and ".."
-        (not (directory-files dir nil 
+        (not (directory-files dir nil
                               "^\\([^.]\\|\\.[^.]\\|\\.\\.[^.]\\).*"))
         (yes-or-no-p (format "Directory %s is empty; remove it? " dir))
         (delete-directory dir))))
 
 (defun vc-rcs-checkin (file rev comment)
   "RCS-specific version of `vc-backend-checkin'."
-  (let ((switches (if (stringp vc-checkin-switches)
-                     (list vc-checkin-switches)
-                   vc-checkin-switches)))
+  (let ((switches (vc-switches 'RCS 'checkin)))
     (let ((old-version (vc-workfile-version file)) new-version
          (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
-      ;; Force branch creation if an appropriate 
+      ;; Force branch creation if an appropriate
       ;; default branch has been set.
       (and (not rev)
           default-branch
@@ -351,7 +341,7 @@ whether to remove it."
        ((and old-version new-version
             (not (string= (vc-branch-part old-version)
                           (vc-branch-part new-version))))
-       (vc-rcs-set-default-branch file 
+       (vc-rcs-set-default-branch file
                                   (if (vc-trunk-p new-version) nil
                                     (vc-branch-part new-version)))
        ;; If this is an old RCS release, we might have
@@ -367,9 +357,7 @@ whether to remove it."
         buffer 0 "co" (vc-name file)
         "-q" ;; suppress diagnostic output
         (concat "-p" rev)
-        (if (stringp vc-checkout-switches)
-            (list vc-checkout-switches)
-          vc-checkout-switches)))
+        (vc-switches 'RCS 'checkout)))
 
 (defun vc-rcs-checkout (file &optional editable rev)
   "Retrieve a copy of a saved version of FILE."
@@ -379,9 +367,7 @@ whether to remove it."
     (save-excursion
       ;; Change buffers to get local value of vc-checkout-switches.
       (if file-buffer (set-buffer file-buffer))
-      (setq switches (if (stringp vc-checkout-switches)
-                        (list vc-checkout-switches)
-                      vc-checkout-switches))
+      (setq switches (vc-switches 'RCS 'checkout))
       ;; Save this buffer's default-directory
       ;; and use save-excursion to make sure it is restored
       ;; in the same buffer it was saved in.
@@ -407,13 +393,13 @@ whether to remove it."
                        (concat "-r" rev)
                      (let ((workrev (vc-workfile-version file)))
                        (if workrev
-                           (concat "-r" 
+                           (concat "-r"
                                    (if (not rev)
                                        ;; no revision specified:
                                        ;; use current workfile version
                                        workrev
                                      ;; REV is t ...
-                                     (if (vc-branch-p workrev)
+                                     (if (not (vc-trunk-p workrev))
                                          ;; ... go to head of current branch
                                          (vc-branch-part workrev)
                                        ;; ... go to head of trunk
@@ -439,7 +425,7 @@ whether to remove it."
 (defun vc-rcs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "co" (vc-name file) "-f"
-                 (concat (if (eq (vc-state file) 'edited) "-u" "-r") 
+                 (concat (if (eq (vc-state file) 'edited) "-u" "-r")
                          (vc-workfile-version file))))
 
 (defun vc-rcs-cancel-version (file editable)
@@ -483,7 +469,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
   "Steal the lock on the current workfile for FILE and revision REV.
 Needs RCS 5.6.2 or later for -M."
   (vc-do-command nil 0 "rcs" (vc-name file) "-M" (concat "-u" rev))
-  ;; Do a real checkout after stealing the lock, so that we see 
+  ;; Do a real checkout after stealing the lock, so that we see
   ;; expanded headers.
   (vc-do-command nil 0 "co" (vc-name file) "-f" (concat "-l" rev)))
 
@@ -504,7 +490,7 @@ Needs RCS 5.6.2 or later for -M."
          (append (list "-q"
                        (concat "-r" oldvers)
                        (and newvers (concat "-r" newvers)))
-                 (vc-diff-switches-list 'RCS))))
+                 (vc-switches 'RCS 'diff))))
 
 \f
 ;;;