Function: ediff-file-checked-out-p

ediff-file-checked-out-p is a byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-file-checked-out-p FILE)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
;; This is a simple-minded check for whether a file is under version control.
;; If file,v exists but file doesn't, this file is considered to be not checked
;; in and not checked out for the purpose of patching (since patch won't be
;; able to read such a file anyway).
;; FILE is a string representing file name
;;(defun ediff-file-under-version-control (file)
;;  (let* ((filedir (file-name-directory file))
;;	 (file-nondir (file-name-nondirectory file))
;;	 (trial (concat file-nondir ",v"))
;;	 (full-trial (concat filedir trial))
;;	 (full-rcs-trial (concat filedir "RCS/" trial)))
;;    (and (stringp file)
;;	 (file-exists-p file)
;;	 (or
;;	  (and
;;	   (file-exists-p full-trial)
;;	   ;; in FAT FS, `file,v' and `file' may turn out to be the same!
;;	   ;; don't be fooled by this!
;;	   (not (equal (file-attributes file)
;;		       (file-attributes full-trial))))
;;	  ;; check if a version is in RCS/ directory
;;	  (file-exists-p full-rcs-trial)))
;;       ))


(defun ediff-file-checked-out-p (file)
  (or (not (featurep 'vc-hooks))
      (and (vc-backend file)
	   (if (fboundp 'vc-state)
	       (or (memq (vc-state file) '(edited needs-merge))
		   (stringp (vc-state file)))))))