*** empty log message ***
[bpt/emacs.git] / lisp / vc-rcs.el
index e17d0d6..7eb3a7c 100644 (file)
@@ -1,11 +1,11 @@
 ;;; vc-rcs.el --- support for RCS version-control
 
-;; Copyright (C) 1992,93,94,95,96,97,98,99,2000  Free Software Foundation, Inc.
+;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001  Free Software Foundation, Inc.
 
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-rcs.el,v 1.13 2000/11/19 09:46:04 spiegel Exp $
+;; $Id: vc-rcs.el,v 1.18 2001/02/01 17:42:03 fx Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -33,7 +33,8 @@
 ;;;
 
 (eval-when-compile
-  (require 'cl))
+  (require 'cl)
+  (require 'vc))
 
 (defcustom vc-rcs-release nil
   "*The release number of your RCS installation, as a string.
@@ -77,9 +78,19 @@ These are passed to the checkout program by \\[vc-rcs-checkout]."
   :version "21.1"
   :group 'vc)
 
+(defcustom vc-rcs-diff-switches nil
+  "*A string or list of strings specifying extra switches for rcsdiff under VC."
+  :type '(choice (const :tag "None" nil)
+                (string :tag "Argument String")
+                (repeat :tag "Argument List"
+                        :value ("")
+                        string))
+  :version "21.1"
+  :group 'vc)
+
 (defcustom vc-rcs-header (or (cdr (assoc 'RCS vc-header-alist)) '("\$Id\$"))
   "*Header keywords to be inserted by `vc-insert-headers'."
-  :type 'string
+  :type '(repeat string)
   :version "21.1"
   :group 'vc)
 
@@ -365,7 +376,7 @@ whether to remove it."
            (vc-do-command nil 1 "rcs" (vc-name file)
                           (concat "-u" old-version))))))))
 
-(defun vc-rcs-checkout (file &optional writable rev workfile)
+(defun vc-rcs-checkout (file &optional editable rev workfile)
   "Retrieve a copy of a saved version of FILE into a workfile."
   (let ((filename (or workfile file))
        (file-buffer (get-file-buffer file))
@@ -389,7 +400,7 @@ whether to remove it."
              ;; RCS can't check out into arbitrary file names directly.
              ;; Use `co -p' and make stdout point to the correct file.
              (let ((vc-modes (logior (file-modes (vc-name file))
-                                     (if writable 128 0)))
+                                     (if editable 128 0)))
                    (failed t))
                (unwind-protect
                    (progn
@@ -399,12 +410,12 @@ whether to remove it."
                           (apply 'vc-do-command
                                  (current-buffer) 0 "co" (vc-name file)
                                  "-q" ;; suppress diagnostic output
-                                 (if writable "-l")
+                                 (if editable "-l")
                                  (concat "-p" rev)
                                  switches)))
                       (set-file-modes filename
                                      (logior (file-modes (vc-name file))
-                                             (if writable 128 0)))
+                                             (if editable 128 0)))
                      (setq failed nil))
                  (and failed (file-exists-p filename)
                       (delete-file filename))))
@@ -419,7 +430,7 @@ whether to remove it."
                     ;; If locking is not strict, force to overwrite
                     ;; the writable workfile.
                     (if (eq (vc-checkout-model file) 'implicit) "-f")
-                    (if writable "-l")
+                    (if editable "-l")
                     (if rev (concat "-r" rev)
                       ;; if no explicit revision was specified,
                       ;; check out that of the working file
@@ -447,9 +458,9 @@ whether to remove it."
   (vc-do-command nil 0 "co" (vc-name file) "-f"
                 (concat "-u" (vc-workfile-version file))))
 
-(defun vc-rcs-cancel-version (file writable)
+(defun vc-rcs-cancel-version (file editable)
   "Undo the most recent checkin of FILE.
-WRITABLE non-nil means previous version should be locked."
+EDITABLE non-nil means previous version should be locked."
   (let* ((target (vc-workfile-version file))
         (previous (if (vc-trunk-p target) "" (vc-branch-part target)))
         (config (current-window-configuration))
@@ -462,7 +473,7 @@ WRITABLE non-nil means previous version should be locked."
       (condition-case err
          (progn
            (vc-do-command nil 0 "co" (vc-name file) "-f"
-                          (concat (if writable "-l" "-u") previous))
+                          (concat (if editable "-l" "-u") previous))
            (setq done t))
        (error (set-buffer "*vc*")
               (goto-char (point-min))
@@ -498,7 +509,7 @@ Needs RCS 5.6.2 or later for -M."
 
 (defun vc-rcs-print-log (file)
   "Get change log associated with FILE."
-  (vc-do-command t 0 "rlog" (vc-name file)))
+  (vc-do-command nil 0 "rlog" (vc-name file)))
 
 (defun vc-rcs-show-log-entry (version)
   (when (re-search-forward
@@ -534,15 +545,11 @@ Needs RCS 5.6.2 or later for -M."
 (defun vc-rcs-diff (file &optional oldvers newvers)
   "Get a difference report using RCS between two versions of FILE."
   (if (not oldvers) (setq oldvers (vc-workfile-version file)))
-  ;; If we know that --brief is not supported, don't try it.
-  (let* ((diff-switches-list (if (listp diff-switches)
-                                diff-switches
-                              (list diff-switches)))
-        (options (append (list "-q"
-                               (concat "-r" oldvers)
-                               (and newvers (concat "-r" newvers)))
-                         diff-switches-list)))
-    (apply 'vc-do-command t 1 "rcsdiff" file options)))
+  (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file
+         (append (list "-q"
+                       (concat "-r" oldvers)
+                       (and newvers (concat "-r" newvers)))
+                 (vc-diff-switches-list rcs))))
 
 \f
 ;;;