Further vcs-cvs/rcs-responsible-p updates from master

* lisp/vc/vc-bzr.el (vc-bzr-responsible-p):
* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-dav.el (vc-dav-responsible-p): Update doc string.

* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Further fixes from
master.

* lisp/vc/vc-src.el (vc-src-responsible-p): Return the directory.

* lisp/vc/vc.el: Update comments.
This commit is contained in:
Lars Ingebrigtsen 2022-04-14 16:51:39 +02:00
parent dc3d1628ec
commit d53c999b4a
7 changed files with 16 additions and 14 deletions

View file

@ -640,7 +640,7 @@ Returns nil if unable to find this information."
;; Could run `bzr status' in the directory and see if it succeeds, but
;; that's relatively expensive.
(defalias 'vc-bzr-responsible-p #'vc-bzr-root
"Return non-nil if FILE is (potentially) controlled by bzr.
"Return the directory if FILE is (potentially) controlled by bzr.
The criterion is that there is a `.bzr' directory in the same
or a superior directory.")

View file

@ -308,12 +308,12 @@ to the CVS command."
(vc-switches 'CVS 'register)))
(defun vc-cvs-responsible-p (file)
"Return non-nil if CVS thinks it is responsible for FILE."
"Return the directory if CVS thinks it is responsible for FILE."
(let ((dir (if (file-directory-p file)
file
(file-name-directory file))))
(and (file-directory-p (expand-file-name "CVS" dir))
dir)))
(file-name-directory (expand-file-name "CVS" dir)))))
(defun vc-cvs-could-register (file)
"Return non-nil if FILE could be registered in CVS.

View file

@ -137,9 +137,9 @@ It should return a status of either 0 (no differences found), or
)
(defun vc-dav-responsible-p (url)
"Return non-nil if DAV considers itself `responsible' for URL."
"Return the URL if DAV considers itself `responsible' for URL."
;; Check for DAV support on the web server.
(and t url))
url)
;;; Unimplemented functions
;;

View file

@ -288,13 +288,13 @@ to the RCS command."
(match-string 1))))))
(defun vc-rcs-responsible-p (file)
"Return non-nil if RCS thinks it would be responsible for registering FILE."
"Return the directory if RCS thinks it would be responsible for FILE."
;; TODO: check for all the patterns in vc-rcs-master-templates
(let ((dir (if (file-directory-p file)
file
(file-name-directory file))))
(and (file-directory-p (expand-file-name "RCS" dir))
dir)))
(file-name-directory (expand-file-name "RCS" dir)))))
(defun vc-rcs-receive-file (file rev)
"Implementation of receive-file for RCS."

View file

@ -212,7 +212,7 @@ to the SCCS command."
(vc-sccs-do-command nil 0 "get" (vc-master-name file)))))
(defun vc-sccs-responsible-p (file)
"Return non-nil if SCCS thinks it would be responsible for registering FILE."
"Return the directory if SCCS thinks it would be responsible for FILE."
;; TODO: check for all the patterns in vc-sccs-master-templates
(or (and (file-directory-p
(expand-file-name "SCCS" (file-name-directory file)))

View file

@ -242,11 +242,13 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
(vc-src-command nil files "add"))
(defun vc-src-responsible-p (file)
"Return non-nil if SRC thinks it would be responsible for registering FILE."
(file-directory-p (expand-file-name ".src"
"Return the directory if SRC thinks it would be responsible for FILE."
(let ((dir (expand-file-name ".src"
(if (file-directory-p file)
file
(file-name-directory file)))))
(and (file-directory-p dir)
dir)))
(defun vc-src-checkin (files comment &optional _rev)
"SRC-specific version of `vc-backend-checkin'.

View file

@ -220,7 +220,7 @@
;;
;; - responsible-p (file)
;;
;; Return non-nil if this backend considers itself "responsible" for
;; Return the directory if this backend considers itself "responsible" for
;; FILE, which can also be a directory. This function is used to find
;; out what backend to use for registration of new files and for things
;; like change log generation. The default implementation always