;;; vc-rcs.el --- support for RCS version-control
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; Free Software Foundation, Inc.
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
-;; $Id$
-
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
(require 'vc))
(defcustom vc-rcs-release nil
- "*The release number of your RCS installation, as a string.
+ "The release number of your RCS installation, as a string.
If nil, VC itself computes this value when it is first needed."
:type '(choice (const :tag "Auto" nil)
(string :tag "Specified")
:group 'vc)
(defcustom vc-rcs-register-switches nil
- "*Extra switches for registering a file in RCS.
-A string or list of strings. These are passed to the checkin program
-by \\[vc-rcs-register]."
- :type '(choice (const :tag "None" nil)
+ "Switches for registering a file in RCS.
+A string or list of strings passed to the checkin program by
+\\[vc-register]. If nil, use the value of `vc-register-switches'.
+If t, use no switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
(string :tag "Argument String")
- (repeat :tag "Argument List"
- :value ("")
- string))
+ (repeat :tag "Argument List" :value ("") string))
: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 or list of strings specifying switches for RCS diff under VC.
+If nil, use the value of `vc-diff-switches'. If t, use no switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
(string :tag "Argument String")
- (repeat :tag "Argument List"
- :value ("")
- 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'."
+ "Header keywords to be inserted by `vc-insert-headers'."
:type '(repeat string)
:version "21.1"
:group 'vc)
(defcustom vc-rcsdiff-knows-brief nil
- "*Indicates whether rcsdiff understands the --brief option.
+ "Indicates whether rcsdiff understands the --brief option.
The value is either `yes', `no', or nil. If it is nil, VC tries
to use --brief and sets this variable to remember whether it worked."
:type '(choice (const :tag "Work out" nil) (const yes) (const no))
;;;###autoload
(defcustom vc-rcs-master-templates
'("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")
- "*Where to look for RCS master files.
+ "Where to look for RCS master files.
For a description of possible values, see `vc-check-master-templates'."
:type '(choice (const :tag "Use standard RCS file names"
'("%sRCS/%s,v" "%s%s,v" "%sRCS/%s"))
(defun vc-rcs-create-repo ()
"Create a new RCS repository."
- ;; RCS is totally file-oriented, so all we have to do is make the directory
+ ;; RCS is totally file-oriented, so all we have to do is make the directory.
(make-directory "RCS"))
(defun vc-rcs-register (files &optional rev comment)
"Register FILES into the RCS version-control system.
REV is the optional revision number for the files. COMMENT can be used
to provide an initial description for each FILES.
-
-`vc-register-switches' and `vc-rcs-register-switches' are passed to
-the RCS command (in that order).
+Passes either `vc-rcs-register-switches' or `vc-register-switches'
+to the RCS command.
Automatically retrieve a read-only version of the file with keywords
expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
(vc-switches 'RCS 'checkout)))
(defun vc-rcs-checkout (file &optional editable rev)
- "Retrieve a copy of a saved version of FILE. If FILE is a directory,
+ "Retrieve a copy of a saved version of FILE. If FILE is a directory,
attempt the checkout for all registered files beneath it."
(if (file-directory-p file)
(mapc 'vc-rcs-checkout (vc-expand-dirs (list file)))
(defun vc-rcs-rollback (files)
"Roll back, undoing the most recent checkins of FILES. Directories are
-expanded to all regidtered subfuiles in them."
+expanded to all registered subfiles in them."
(if (not files)
(error "RCS backend doesn't support directory-level rollback."))
(dolist (file (vc-expand-dirs files))
(defun vc-rcs-steal-lock (file &optional rev)
"Steal the lock on the current workfile for FILE and revision REV.
-If FUILEis a directory, steal the lock on all registered files beneath it.
+If FILE is a directory, steal the lock on all registered files beneath it.
Needs RCS 5.6.2 or later for -M."
(if (file-directory-p file)
(mapc 'vc-rcs-steal-lock (vc-expand-dirs (list file)))
;;; Internal functions
;;;
-(defun vc-rcs-root (dir)
- (vc-find-root dir "RCS" t))
-
(defun vc-rcs-workfile-is-newer (file)
"Return non-nil if FILE is newer than its RCS master.
This likely means that FILE has been changed with respect
(defun vc-rcs-fetch-master-state (file &optional working-revision)
"Compute the master file's idea of the state of FILE.
-If a WORKFILE-VERSION is given, compute the state of that version,
+If a WORKING-REVISION is given, compute the state of that version,
otherwise determine the workfile version based on the master file.
This function sets the properties `vc-working-revision' and
`vc-checkout-model' to their correct values, based on the master
(defun vc-rcs-system-release ()
"Return the RCS release installed on this system, as a string.
-Return symbol UNKNOWN if the release cannot be deducted. The user can
+Return symbol `unknown' if the release cannot be deducted. The user can
override this using variable `vc-rcs-release'.
If the user has not set variable `vc-rcs-release' and it is nil,