From d53c999b4ad7bc1f730875ae3d1af9d11895807c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 14 Apr 2022 16:51:39 +0200 Subject: [PATCH] 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. --- lisp/vc/vc-bzr.el | 2 +- lisp/vc/vc-cvs.el | 4 ++-- lisp/vc/vc-dav.el | 4 ++-- lisp/vc/vc-rcs.el | 4 ++-- lisp/vc/vc-sccs.el | 2 +- lisp/vc/vc-src.el | 12 +++++++----- lisp/vc/vc.el | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 836630acb5d..ee394a93af4 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -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.") diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index e4524db951b..8f06d5a847a 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -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. diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 61e2cd23900..94621599e4a 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el @@ -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 ;; diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index dc6f3c89159..fb57b2bbc6e 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -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." diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el index ef64cd9d580..0df70c8f232 100644 --- a/lisp/vc/vc-sccs.el +++ b/lisp/vc/vc-sccs.el @@ -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))) diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index 1c1a7b5d139..5a252c55cb2 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -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" - (if (file-directory-p file) - file - (file-name-directory file))))) + "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'. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 45c09ae1c6a..bebd0946dee 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -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 -- 2.39.2