emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/package+vc ca61e768d0 3/3: Use user option 'package-vc-default-b


From: Philip Kaludercic
Subject: feature/package+vc ca61e768d0 3/3: Use user option 'package-vc-default-backend' when cloning
Date: Sun, 23 Oct 2022 12:30:38 -0400 (EDT)

branch: feature/package+vc
commit ca61e768d0d599657b4f8e998fb74eccee58c8f6
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Use user option 'package-vc-default-backend' when cloning
    
    * lisp/emacs-lisp/package-vc.el (package-vc-unpack): Respect
    'package-vc-default-backend'.
---
 lisp/emacs-lisp/package-vc.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 082e8f17f6..dd451e80f4 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -102,10 +102,13 @@
   :version "29.1")
 
 (defcustom package-vc-default-backend 'Git
-  "VC backend to use as a fallback."
-  :type `(choice
-          ,@(mapcar (lambda (b) (list 'const b))
-                    vc-handled-backends))
+  "Default VC backend used when cloning a package repository.
+If no repository type was specified or could be guessed by
+`package-vc-heusitic-alist', the VC backend denoted by this
+symbol is used.  The value must be a member of
+`vc-handled-backends' that implements the `clone' function."
+  :type `(choice ,@(mapcar (lambda (b) (list 'const b))
+                           vc-handled-backends))
   :version "29.1")
 
 (defvar package-vc-archive-spec-alist nil
@@ -357,8 +360,9 @@ the `:brach' attribute in PKG-SPEC."
       ;; Clone the repository into `repo-dir' if necessary
       (unless (file-exists-p repo-dir)
         (make-directory (file-name-directory repo-dir) t)
-        (let ((backend (and url (alist-get url package-vc-heusitic-alist
-                                           nil nil #'string-match-p))))
+        (let ((backend (or (and url (alist-get url package-vc-heusitic-alist
+                                               nil nil #'string-match-p))
+                           package-vc-default-backend)))
           (unless (vc-clone url backend repo-dir (or rev branch))
             (error "Failed to clone %s from %s" name url))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]