Function: majutsu-jj-revset-candidate-data

majutsu-jj-revset-candidate-data is a natively compiled function defined in majutsu-jj.el.

Signature

(majutsu-jj-revset-candidate-data)

Documentation

Return revset completion payload.

The return value is a plist with keys :category and :candidates. Candidates are repository references: other workspaces' working-copy refs (<workspace>@), bookmarks, and tags.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jj.el
(defun majutsu-jj-revset-candidate-data ()
  "Return revset completion payload.
The return value is a plist with keys :category and :candidates.
Candidates are repository references: other workspaces' working-copy
refs (`<workspace>@'), bookmarks, and tags."
  (let ((seen (make-hash-table :test #'equal))
        (candidates nil))
    (cl-labels ((add (candidate)
                  (when (and (stringp candidate)
                             (not (string-empty-p candidate))
                             (not (gethash candidate seen)))
                    (puthash candidate t seen)
                    (push candidate candidates))))
      (dolist (name (majutsu-jj--safe-lines
                     "workspace" "list" "-T" "name ++ \"\\n\""))
        (add (concat name "@")))
      (dolist (name (majutsu-jj--safe-lines
                     "bookmark" "list" "--quiet" "-T" "name ++ \"\\n\""))
        (add name))
      (dolist (name (majutsu-jj--safe-lines
                     "tag" "list" "--quiet" "-T" "name ++ \"\\n\""))
        (add name)))
    (list :category 'majutsu-revision
          :candidates (nreverse candidates))))