[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got 5fb2f47 099/145: implement revision-completion-t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got 5fb2f47 099/145: implement revision-completion-table |
Date: |
Thu, 9 Sep 2021 15:58:42 -0400 (EDT) |
branch: externals/vc-got
commit 5fb2f47455079158990731f00c405d0fa88788a6
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
implement revision-completion-table
---
vc-got.el | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/vc-got.el b/vc-got.el
index 92b9a8c..64c938c 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -78,7 +78,7 @@
;; - comment-history NOT IMPLEMENTED
;; - update-changelog NOT IMPLEMENTED
;; * diff DONE
-;; - revision-completion-table NOT IMPLEMENTED
+;; - revision-completion-table DONE
;; - annotate-command DONE
;; - annotate-time DONE
;; - annotate-current-time NOT IMPLEMENTED
@@ -374,6 +374,21 @@ files on disk."
(when keep-local "-k")
file)))))
+(defun vc-got--ref ()
+ "Return a list of all references."
+ (let (process-file-side-effects
+ (re "^refs/\\(heads\\|remotes\\|tags\\)/\\(.*\\):")
+ ;; hardcoding HEAD because it's always present and the regexp
+ ;; won't match it.
+ (table (list "HEAD")))
+ (vc-got-with-worktree default-directory
+ (with-temp-buffer
+ (when (zerop (vc-got--call "ref" "-l"))
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (push (match-string 2) table))
+ table)))))
+
;; Backend properties
@@ -708,6 +723,14 @@ Heavily inspired by `vc-git-log-view-mode'."
;; (i.e. get the patch from `got log -p rev1')
(vc-got--diff rev1 rev2))))))
+(defun vc-got-revision-completion-table (_files)
+ "Return a completion table for existing revisions.
+Ignores FILES because GoT doesn't have the concept of ``file
+revisions''; instead, like with git, you have tags and branches."
+ (letrec ((table (lazy-completion-table
+ table (lambda () (vc-got--ref)))))
+ table))
+
(defun vc-got-annotate-command (file buf &optional rev)
"Show annotated contents of FILE in buffer BUF. If given, use revision REV."
(let (process-file-side-effects)
- [elpa] externals/vc-got 67332ba 076/145: docs fixes, (continued)
- [elpa] externals/vc-got 67332ba 076/145: docs fixes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5b4a6b9 069/145: more docs, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a323f60 071/145: show list of files when committing staged stuff, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit to commit staged changes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got dcb5b83 083/145: extract the filtering to its own function, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 76d978f 082/145: minor tweaks, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got cb97383 085/145: ignore ignored files but not up-to-date ones, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 445e2bd 087/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2d039a2 089/145: fix vc-dir listing on sub-directories, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2b7241a 086/145: revamp readme, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5fb2f47 099/145: implement revision-completion-table,
ELPA Syncer <=
- [elpa] externals/vc-got 0a3316a 091/145: implement log-view-mode, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8014bde 101/145: implement half create-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got e9a5df0 098/145: make vc-annotate-show-diff-revision-at-line works, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 567c17a 093/145: vc-got trims '----' by itself now, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 1870c8b 094/145: add a space when prompting for the push/pull operations, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got c151c25 095/145: implement vc-got-find-file-hook, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8ec0bb7 107/145: guard vc-got-diff against nil files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got db89d6f 114/145: add a wrapper for the update command, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ae2ad57 123/145: don't need mark-resolved and find-admin-dir, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 09d5937 103/145: implement retrieve-tag and complete the tag system!, ELPA Syncer, 2021/09/09