(toplevel): Provide `descr-text'.
[bpt/emacs.git] / lisp / vc-sccs.el
index 0c353eb..3c4817a 100644 (file)
@@ -1,11 +1,11 @@
 ;;; vc-sccs.el --- support for SCCS 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-sccs.el,v 1.5 2000/11/16 18:14:41 spiegel Exp $
+;; $Id: vc-sccs.el,v 1.14 2002/02/25 22:05:16 spiegel Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -28,6 +28,9 @@
 
 ;;; Code:
 
+(eval-when-compile 
+  (require 'vc))
+
 ;;; 
 ;;; Customization options
 ;;;
@@ -44,9 +47,20 @@ A string or list of strings passed to the checkin program by
   :version "21.1"
   :group 'vc)
 
+(defcustom vc-sccs-diff-switches nil
+  "*A string or list of strings specifying extra switches for `vcdiff',
+the diff utility used for SCCS 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-sccs-header (or (cdr (assoc 'SCCS vc-header-alist)) '("%W%"))
   "*Header keywords to be inserted by `vc-insert-headers'."
-  :type 'string
+  :type '(repeat string)
   :group 'vc)
 
 ;;;###autoload
@@ -128,9 +142,9 @@ For a description of possible values, see `vc-check-master-templates'."
 
 (defun vc-sccs-workfile-unchanged-p (file)
   "SCCS-specific implementation of vc-workfile-unchanged-p."
-  (apply 'vc-do-command nil 1 "vcdiff" (vc-name file)
-         (list "--brief" "-q"
-               (concat "-r" (vc-workfile-version file)))))
+  (zerop (apply 'vc-do-command nil 1 "vcdiff" (vc-name file)
+                (list "--brief" "-q"
+                      (concat "-r" (vc-workfile-version file))))))
 
 \f
 ;;;
@@ -147,7 +161,7 @@ the SCCS 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* ((switches (list
+    (let* ((switches (append
                     (if (stringp vc-register-switches)
                         (list vc-register-switches)
                       vc-register-switches)
@@ -160,12 +174,11 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
       (let ((vc-name
             (or project-file
                 (format (car vc-sccs-master-templates) dirname basename)))|)
-       (apply 'vc-do-command nil 0 "admin" nil
+       (apply 'vc-do-command nil 0 "admin" vc-name
               (and rev (concat "-r" rev))
               "-fb"
-              (concat "-i" file)
+              (concat "-i" (file-relative-name file))
               (and comment (concat "-y" comment))
-              vc-name
               switches))
       (delete-file file)
       (if vc-keep-workfiles
@@ -248,7 +261,7 @@ locked.  REV is the revision to check out into WORKFILE."
                   switches)))))
     (message "Checking out %s...done" filename)))
 
-(defun vc-sccs-revert (file)
+(defun vc-sccs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "unget" (vc-name file))
   (vc-do-command nil 0 "get" (vc-name file))
@@ -279,7 +292,7 @@ EDITABLE non-nil means previous version should be locked."
 
 (defun vc-sccs-print-log (file)
   "Get change log associated with FILE."
-  (vc-do-command t 0 "prs" (vc-name file)))
+  (vc-do-command nil 0 "prs" (vc-name file)))
 
 (defun vc-sccs-logentry-check ()
   "Check that the log entry in the current buffer is acceptable for SCCS."
@@ -291,14 +304,11 @@ EDITABLE non-nil means previous version should be locked."
   "Get a difference report using SCCS between two versions of FILE."
   (setq oldvers (vc-sccs-lookup-triple file oldvers))
   (setq newvers (vc-sccs-lookup-triple file newvers))
-  (let* ((diff-switches-list (if (listp diff-switches)
-                                diff-switches
-                              (list diff-switches)))
-        (options (append (list "-q"
-                               (and oldvers (concat "-r" oldvers))
-                               (and newvers (concat "-r" newvers)))
-                         diff-switches-list)))
-    (apply 'vc-do-command t 1 "vcdiff" (vc-name file) options)))
+  (apply 'vc-do-command "*vc-diff*" 1 "vcdiff" (vc-name file) 
+         (append (list "-q"
+                       (and oldvers (concat "-r" oldvers))
+                       (and newvers (concat "-r" newvers)))
+                 (vc-diff-switches-list 'SCCS))))
 
 \f
 ;;;
@@ -408,6 +418,3 @@ If NAME is nil or a version number string it's just passed through."
 (provide 'vc-sccs)
 
 ;;; vc-sccs.el ends here
-
-
-