;; permissions can tell us whether locking is used for
;; the file or not.
(if (and (eq state 'up-to-date)
- (not (vc-mistrust-permissions file)))
+ (not (vc-mistrust-permissions file))
+ (file-exists-p file))
(cond
((string-match ".rw..-..-." (nth 8 (file-attributes file)))
(vc-file-setprop file 'vc-checkout-model 'implicit)
(let* ((attributes (file-attributes file 'string))
(owner-name (nth 2 attributes))
(permissions (nth 8 attributes)))
- (cond ((string-match ".r-..-..-." permissions)
+ (cond ((and permissions (string-match ".r-..-..-." permissions))
(vc-file-setprop file 'vc-checkout-model 'locking)
'up-to-date)
- ((string-match ".rw..-..-." permissions)
+ ((and permissions (string-match ".rw..-..-." permissions))
(if (eq (vc-rcs-checkout-model file) 'locking)
(if (file-ownership-preserved-p file)
'edited
(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)))
(message "Checking out %s...done" file))))))
(defun vc-rcs-rollback (files)
- "Roll back, undoing the most recent checkins of FILES. Directories are
-expanded to all regidtered subfuiles in them."
+ "Roll back, undoing the most recent checkins of FILES. Directories are
+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))
(signal (car err) (cdr err)))))))))
(defun vc-rcs-revert (file &optional contents-done)
- "Revert FILE to the version it was based on. If FILE is a directory,
+ "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)
(mapc 'vc-rcs-revert (vc-expand-dirs (list file)))
(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)))
(insert (gethash (get-text-property (point) :vc-rcs-r/d/a) ht))
(forward-line 1))))
+(declare-function vc-annotate-convert-time "vc-annotate" (time))
+
(defun vc-rcs-annotate-current-time ()
"Return the current time, based at midnight of the current day, and
encoded as fractional days."
\f
;;;
-;;; Snapshot system
+;;; Tag system
;;;
-(defun vc-rcs-assign-name (file name)
- "Assign to FILE's latest version a given NAME."
- (vc-do-command "*vc*" 0 "rcs" (vc-name file) (concat "-n" name ":")))
+(defun vc-rcs-create-tag (backend dir name branchp)
+ (when branchp
+ (error "RCS backend %s does not support module branches" backend))
+ (let ((result (vc-tag-precondition dir)))
+ (if (stringp result)
+ (error "File %s is not up-to-date" result)
+ (vc-file-tree-walk
+ dir
+ (lambda (f)
+ (vc-do-command "*vc*" 0 "rcs" (vc-name f) (concat "-n" name ":")))))))
\f
;;;
;;; 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,