Function: majutsu-squash--destination-revset

majutsu-squash--destination-revset is a natively compiled function defined in majutsu-squash.el.

Signature

(majutsu-squash--destination-revset SOURCE-REVSET EXPLICIT-SOURCE)

Documentation

Return inferred destination revset for SOURCE-REVSET.

If EXPLICIT-SOURCE is non-nil and point is on a commit outside SOURCE-REVSET, prefer point as the destination. Otherwise use SOURCE-REVSET's external parent. The resulting revset is intentionally left for jj to resolve.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-squash.el
(defun majutsu-squash--destination-revset (source-revset explicit-source)
  "Return inferred destination revset for SOURCE-REVSET.
If EXPLICIT-SOURCE is non-nil and point is on a commit outside SOURCE-REVSET,
prefer point as the destination.  Otherwise use SOURCE-REVSET's external parent.
The resulting revset is intentionally left for jj to resolve."
  (let ((parent (format "parents(roots(%s))" source-revset)))
    (if-let* ((point (and explicit-source (majutsu-revision-at-point))))
        (format "coalesce((%s) ~ (%s), %s)" point source-revset parent)
      parent)))