Make all vc-*-responsible-p functions return a string

* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-dav.el (vc-dav-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Return a file name
instead of t when we get a match (which is what
vc-backend-for-registration expects) (bug#51800).

This fixes the regression reported in bug#54935.

Do not merge to master.
This commit is contained in:
Lars Ingebrigtsen 2021-11-14 02:38:48 +01:00
parent b201823f63
commit bc63651588
4 changed files with 19 additions and 13 deletions

View file

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

View file

@ -136,10 +136,10 @@ It should return a status of either 0 (no differences found), or
"Find the version control state of all files in DIR in a fast way."
)
(defun vc-dav-responsible-p (_url)
(defun vc-dav-responsible-p (url)
"Return non-nil if DAV considers itself `responsible' for URL."
;; Check for DAV support on the web server.
t)
(and t url))
;;; Unimplemented functions
;;

View file

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

View file

@ -214,9 +214,13 @@ to the SCCS command."
(defun vc-sccs-responsible-p (file)
"Return non-nil if SCCS thinks it would be responsible for registering FILE."
;; TODO: check for all the patterns in vc-sccs-master-templates
(or (file-directory-p (expand-file-name "SCCS" (file-name-directory file)))
(stringp (vc-sccs-search-project-dir (or (file-name-directory file) "")
(file-name-nondirectory file)))))
(or (and (file-directory-p
(expand-file-name "SCCS" (file-name-directory file)))
file)
(let ((dir (vc-sccs-search-project-dir (or (file-name-directory file) "")
(file-name-nondirectory file))))
(and (stringp dir)
dir))))
(defun vc-sccs-checkin (files comment &optional rev)
"SCCS-specific version of `vc-backend-checkin'."