]> git.eshelyaron.com Git - emacs.git/commitdiff
Make all vc-*-responsible-p functions return a string
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Nov 2021 01:38:48 +0000 (02:38 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Nov 2021 01:38:48 +0000 (02:38 +0100)
* 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).

lisp/vc/vc-cvs.el
lisp/vc/vc-dav.el
lisp/vc/vc-rcs.el
lisp/vc/vc-sccs.el

index 6f921ac2a04a004632bcc9c48ee1bfedecbc1404..7062c4971f8ef5cfdac61c274a4040edead5ee4e 100644 (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.
index fe631ee09a7ef19f61a01eb29803eef669b6e30e..49a8af10e783d2d6b9da09b339eabb0beda5082d 100644 (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
 ;;
index e38469ba9f0af39743c46138b8812b6fe44ff6b0..226e162d8ba20c0d716629c49ff8f6dc66fb62d7 100644 (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."
index bcbb87eba8e16473bb16f7badcfe91a60d15185d..d59ccb37b3be090e95a3b0421d8b8b4cedf93f20 100644 (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'."