[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin 855b707b22: elpa-admin.el: Fix various problems trigge
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin 855b707b22: elpa-admin.el: Fix various problems triggered by ada-mode |
Date: |
Wed, 2 Nov 2022 14:08:49 -0400 (EDT) |
branch: elpa-admin
commit 855b707b2236a4c5348a6bb7fffca2883a00c6c3
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
elpa-admin.el: Fix various problems triggered by ada-mode
Handle the case where the main branch has a non-snapshot version.
Also handle the case where the `:release-branch` is not fully merged
into the main branch.
* elpa-admin.el (elpaa--select-revision): Use a detached checkout.
(elpaa--clean): Save&restore the current branch and its rev.
(elpaa--make-one-package): Treat all versions from the main branch as
snapshots when `:release-branch` is specified.
---
elpa-admin.el | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index 817f7dc380..c78cd04020 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -317,7 +317,7 @@ returns. Return the selected revision."
(with-temp-buffer
;; Run it within the true-filename directory holding the mainfile,
;; so that for :core packages we properly affect the Emacs tree.
- (elpaa--call t "git" "reset" "--merge" rev)
+ (elpaa--call t "git" "checkout" "--detach" rev)
(elpaa--message "Reverted to release revision %s\n%s"
rev (buffer-string)))
;; We should make sure we go back to the head of the branch afterwards,
@@ -377,7 +377,15 @@ returns. Return the selected revision."
(let* ((default-directory (elpaa--dirname dir))
(generated-files
(directory-files "." nil
- "-\\(pkg\\|autoloads\\)\\.el\\'\\|\\.elc\\'")))
+ "-\\(pkg\\|autoloads\\)\\.el\\'\\|\\.elc\\'"))
+ (rev (with-temp-buffer
+ (when (zerop (elpaa--call t "git" "rev-parse" "HEAD"))
+ (buffer-substring (point-min) (1- (point-max))))))
+ (branch
+ (with-temp-buffer
+ (and (zerop (elpaa--call t "git" "branch" "--show-current"))
+ (> (buffer-size) 0)
+ (buffer-substring (point-min) (1- (point-max)))))))
(mapc #'delete-file generated-files)
(when (file-exists-p ".git")
(with-temp-buffer
@@ -410,7 +418,11 @@ returns. Return the selected revision."
(with-temp-buffer
(let* ((default-directory (elpaa--dirname dir)))
(elpaa--call t "git" "clean" "-x" "-d" "-f")
- (elpaa--call t "git" "checkout" "--" "."))
+ (elpaa--call t "git" "reset" "--hard")
+ (when branch
+ (elpaa--call t "git" "checkout" branch))
+ (when rev
+ (elpaa--call t "git" "reset" "--hard" rev)))
(elpaa--message "%s" (buffer-string)))))))))
(defvar elpaa--keep-max 20)
@@ -1007,7 +1019,8 @@ place the resulting tarball into the file named
TARBALL-ONLY."
(elpaa--message "Package %s not released yet!" pkgname))
;; negative version numbers are used for pre-releases
;; (i.e. snapshots, alpha, beta, and rc).
- ((< (apply #'min (version-to-list vers)) 0)
+ ((or (< (apply #'min (version-to-list vers)) 0)
+ (elpaa--spec-get pkg-spec :release-branch))
(cond
((not (or new
;; Even if there's nothing new on the devel branch,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] elpa-admin 855b707b22: elpa-admin.el: Fix various problems triggered by ada-mode,
Stefan Monnier <=