-;;; vc-rcs.el --- support for RCS version-control
+;;; vc-rcs.el --- support for RCS version-control -*- lexical-binding:t -*-
-;; Copyright (C) 1992-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
:type '(choice (const :tag "Work out" nil) (const yes) (const no))
:group 'vc-rcs)
+;; This needs to be autoloaded because vc-rcs-registered uses it (via
+;; vc-default-registered), and vc-hooks needs to be able to check
+;; for a registered backend without loading every backend.
;;;###autoload
(defcustom vc-rcs-master-templates
(purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s"))
(vc-rcs-state file))))
(vc-rcs-state file)))))
+(autoload 'vc-expand-dirs "vc")
+
(defun vc-rcs-dir-status (dir update-function)
;; FIXME: this function should be rewritten or `vc-expand-dirs'
;; should be changed to take a backend parameter. Using
;; RCS is totally file-oriented, so all we have to do is make the directory.
(make-directory "RCS"))
+(autoload 'vc-switches "vc")
+
(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
;; No, it was some other error: re-signal it.
(signal (car err) (cdr err)))))))))
-(defun vc-rcs-revert (file &optional contents-done)
+(defun vc-rcs-revert (file &optional _contents-done)
"Revert FILE to the version it was based on. If FILE is a directory,
revert all registered files beneath it."
(if (file-directory-p file)
(when (looking-at "[\b\t\n\v\f\r ]+")
(delete-char (- (match-end 0) (match-beginning 0))))))
-(defun vc-rcs-print-log (files buffer &optional shortlog start-revision-ignored limit)
- "Get change log associated with FILE. If FILE is a
-directory the operation is applied to all registered files beneath it."
- (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs files)))
+(defun vc-rcs-print-log (files buffer &optional _shortlog
+ _start-revision-ignored limit)
+ "Print commit log associated with FILES into specified BUFFER.
+Remaining arguments are ignored.
+If FILE is a directory the operation is applied to all registered
+files beneath it."
+ (vc-do-command (or buffer "*vc*") 0 "rlog"
+ (mapcar 'vc-name (vc-expand-dirs files)))
(with-current-buffer (or buffer "*vc*")
(vc-rcs-print-log-cleanup))
(when limit 'limit-unsupported))
;;; Tag system
;;;
+(autoload 'vc-tag-precondition "vc")
+(declare-function vc-file-tree-walk "vc" (dirname func &rest args))
+
(defun vc-rcs-create-tag (dir name branchp)
(when branchp
(error "RCS backend does not support module branches"))
(string-match "[0-9]+\\'" rev)
(substring rev (match-beginning 0) (match-end 0)))
-(defun vc-rcs-previous-revision (file rev)
+(defun vc-rcs-previous-revision (_file rev)
"Return the revision number immediately preceding REV for FILE,
or nil if there is no previous revision. This default
implementation works for MAJOR.MINOR-style revision numbers as
(t "rcs2log")))
"Path to the `rcs2log' program (normally in `exec-directory').")
+(autoload 'vc-buffer-sync "vc-dispatcher")
+
(defun vc-rcs-update-changelog (files)
"Default implementation of update-changelog.
Uses `rcs2log' which only works for RCS and CVS."
nil t)
(replace-match "$\\1$"))))
+(autoload 'vc-rename-master "vc")
+
(defun vc-rcs-rename-file (old new)
;; Just move the master file (using vc-rcs-master-templates).
(vc-rename-master (vc-name old) new vc-rcs-master-templates))
;; only the former since it behaves identically to the
;; latter in the absence of "@@".)
sub)
- (cl-flet ((incg (beg end)
- (let ((b beg) (e end) @-holes)
+ (cl-flet ((incg (_beg end)
+ (let ((e end) @-holes)
(while (and asc (< (car asc) e))
(push (pop asc) @-holes))
;; Self-deprecate when work is done.