[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got dec54a7 088/145: improve vc-got-{push, pull}
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got dec54a7 088/145: improve vc-got-{push, pull} |
Date: |
Thu, 9 Sep 2021 15:58:39 -0400 (EDT) |
branch: externals/vc-got
commit dec54a7421874b547a977b2295288fb7e25e36c7
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
improve vc-got-{push,pull}
Switches from #'vc-do-command to #'vc-do-async-command in
vc-got--push-pull and sets the vc-compilation-mode. This means that
now the push/fetch buffer behaves just like the one from vc-got: one
can press `q' to quit and `g' to do the operation again.
fixes #15
---
vc-got.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index bb01f47..24b3039 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -575,28 +575,40 @@ If REV is t, checkout from the head."
(when branch
(vc-got--integrate branch))))
-(defun vc-got--push-pull (cmd op prompt root)
- "Execute CMD OP, or prompt the user if PROMPT is non-nil.
-ROOT is the worktree root."
- (let ((buffer (format "*vc-got : %s*" (expand-file-name root))))
+(defun vc-got--push-pull (cmd op prompt)
+ "Execute CMD OP, or prompt the user if PROMPT is non-nil."
+ (let ((buffer (format "*vc-got : %s*" (expand-file-name default-directory))))
(when-let (cmd (if prompt
(split-string
(read-shell-command (format "%s %s command: " cmd op)
(format "%s %s" cmd op))
" " t)
(list cmd op)))
- (apply #'vc-do-command buffer 0 (car cmd) nil (cdr cmd)))))
+ (apply #'vc-do-async-command buffer default-directory cmd)
+ ;; this comes from vc-git.el. We're using git to push, so in
+ ;; part it makes sense, but we should revisit for full Got
+ ;; support.
+ (with-current-buffer buffer
+ (vc-compilation-mode 'git)
+ (let ((comp-cmd (mapconcat #'identity cmd " ")))
+ (setq-local compile-command comp-cmd
+ compilation-directory default-directory
+ compilation-arguments (list comp-cmd
+ nil
+ (lambda (_ign) buffer)
+ nil))))
+ (vc-set-async-update buffer))))
(defun vc-got-pull (prompt)
"Execute got pull, prompting the user for the full command if PROMPT is not
nil."
- (vc-got--push-pull vc-got-program "fetch" prompt (vc-got-root
default-directory)))
+ (let ((default-directory (vc-got-root default-directory)))
+ (vc-got--push-pull vc-got-program "fetch" prompt)))
(defun vc-got-push (prompt)
"Run git push (not got!) in the repository dir.
If PROMPT is non-nil, prompt for the git command to run."
- (let* ((root (vc-got-root default-directory))
- (default-directory (vc-got--repo-root)))
- (vc-got--push-pull "git" "push" prompt root)))
+ (let ((default-directory (vc-got--repo-root)))
+ (vc-got--push-pull "git" "push" prompt)))
(defun vc-got-print-log (files buffer &optional _shortlog start-revision limit)
"Insert the revision log for FILES into BUFFER.
- [elpa] externals/vc-got d54ceb8 041/145: make got program be customizable, (continued)
- [elpa] externals/vc-got d54ceb8 041/145: make got program be customizable, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7c257a7 042/145: Merge pull request #1 from zmyrgel/feature/expand-implementation-status, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f09d635 045/145: Merge pull request #2 from zmyrgel/feature/add-version-command, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got febb894 043/145: Add new customization group `vc-got' under vc, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a2474a4 048/145: improve vc-got-dir-status-files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7bb16f7 053/145: implement conflicted-files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 3cdb075 058/145: update status list a bit, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got cf4e3eb 070/145: fix vc-got-dir-status-files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6f42ede 081/145: don't create temp buffers for nothing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got b2721e8 080/145: set status to 'staged if a file has all its modification staged, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got dec54a7 088/145: improve vc-got-{push, pull},
ELPA Syncer <=
- [elpa] externals/vc-got 424f515 100/145: don't need annotate-current-time; split the sections, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ad36649 092/145: due piccoli errori di battitura corretti, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6a973a7 106/145: simplify vc-got-root, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got e7747ce 109/145: use log-edit-extract-headers instead of the ugly workaround, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 26362bf 110/145: improve error message reporting for vc-got-checkin, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5212464 115/145: there is no need to require cl-seq, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 83559c7 108/145: add a TODO for the files handling in vc-got-diff, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 186da17 126/145: add a short description under commentary, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and remove the ugly hack, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2552a6c 104/145: mark find-ignore-file as done and move it to the right place, ELPA Syncer, 2021/09/09