summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-10-23 18:04:55 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-10-23 18:04:55 +0200
commit2154219059a21d6aad2e7e390187d78029fff3d0 (patch)
tree81573032a66e7f9cd941a22389ecd5d1f5d638b8 /lisp/emacs-lisp
parenta0532e148cca6fc9ede11fda2c9dda20cac4eca5 (diff)
downloademacs-2154219059a21d6aad2e7e390187d78029fff3d0.tar.gz
emacs-2154219059a21d6aad2e7e390187d78029fff3d0.tar.bz2
emacs-2154219059a21d6aad2e7e390187d78029fff3d0.zip
Immediately check out the right branch or revision
* lisp/emacs-lisp/package-vc.el (package-vc-unpack) Use REV to avoid checking out the wrong branch/revision first. * lisp/vc/vc-bzr.el: Handle REV. * lisp/vc/vc-git.el: Handle REV. * lisp/vc/vc-hg.el: Handle REV. * lisp/vc/vc-svn.el: Handle REV. * lisp/vc/vc.el: Make BACKEND optional and add REV.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package-vc.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 25ac10bd08e..61f8fb86ee5 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -336,8 +336,7 @@ the `:brach' attribute in PKG-SPEC."
(if (yes-or-no-p "Overwrite previous checkout?")
(package--delete-directory pkg-dir pkg-desc)
(error "There already exists a checkout for %s" name)))
- (pcase-let* ((extras (package-desc-extras pkg-desc))
- ((map :url :branch :lisp-dir) pkg-spec)
+ (pcase-let* (((map :url :branch :lisp-dir) pkg-spec)
(repo-dir
(if (null lisp-dir)
pkg-dir
@@ -353,18 +352,15 @@ 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)
- (unless (vc-clone (or (alist-get :vc-backend extras)
- package-vc-default-backend)
- url repo-dir)
- (error "Failed to clone %s from %s" name url)))
+ (let ((backend (and url (alist-get url package-vc-heusitic-alist
+ nil nil #'string-match-p))))
+ (unless (vc-clone url backend repo-dir (or rev branch))
+ (error "Failed to clone %s from %s" name url))))
(unless (eq pkg-dir repo-dir)
;; Link from the right position in `repo-dir' to the package
;; directory in the ELPA store.
- (make-symbolic-link (file-name-concat repo-dir lisp-dir) pkg-dir))
- (when-let* ((default-directory repo-dir) (rev (or rev branch)))
- (vc-retrieve-tag pkg-dir rev)))
-
+ (make-symbolic-link (file-name-concat repo-dir lisp-dir) pkg-dir)))
(package-vc-unpack-1 pkg-desc pkg-dir)))
(defun package-vc-sourced-packages-list ()