Function: vc-rcs-register

vc-rcs-register is a byte-compiled function defined in vc-rcs.el.gz.

Signature

(vc-rcs-register FILES &optional COMMENT)

Documentation

Register FILES into the RCS version control system.

Automatically retrieve a read-only version of the file with keywords expanded. COMMENT can be used to provide an initial description for each FILES. Passes either vc-rcs-register-switches or vc-register-switches to the RCS command.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-rcs.el.gz
(defun vc-rcs-register (files &optional comment)
  "Register FILES into the RCS version control system.
Automatically retrieve a read-only version of the file with keywords expanded.
COMMENT can be used to provide an initial description for each FILES.
Passes either `vc-rcs-register-switches' or `vc-register-switches'
to the RCS command."
  (let (subdir name)
    (dolist (file files)
      (and (not (file-exists-p
		 (setq subdir (expand-file-name "RCS"
						(file-name-directory file)))))
	   (not (directory-files (file-name-directory file)
				 nil ",v\\'" t))
	   (yes-or-no-p "Create RCS subdirectory? ")
	   (make-directory subdir))
      (apply #'vc-do-command "*vc*" 0 "ci" file
	     ;; if available, use the secure registering option
	     (and (vc-rcs-release-p "5.6.4") "-i")
	     "-u"
             ;; 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*"
	(goto-char (point-min))
	(if (not (setq name
		       (if (looking-at (concat "^\\(.*\\)  <--	"
					       (file-name-nondirectory file)))
			   (match-string 1))))
	    ;; if we couldn't find the master name,
	    ;; run vc-rcs-registered to get it
	    ;; (will be stored into the vc-master-name property)
	    (vc-rcs-registered file)
	  (vc-file-setprop file 'vc-master-name
			   (if (file-name-absolute-p name)
			       name
			     (expand-file-name
			      name
			      (file-name-directory file))))))
      (vc-file-setprop file 'vc-working-revision
		       (if (re-search-forward
			    "^initial revision: \\([0-9.]+\\).*\n"
			    nil t)
			   (match-string 1))))))