Function: log-view--pick-or-revert
log-view--pick-or-revert is a byte-compiled function defined in
log-view.el.gz.
Signature
(log-view--pick-or-revert DIRECTORY NO-COMMENT REVERSE INTERACTIVE DELETE)
Documentation
Copy changes from revision at point or all marked revisions.
DIRECTORY is the destination, the root of the target working tree.
NO-COMMENT non-nil means use the log messages of the revisions
unmodified, instead of using the backend's default cherry-pick comment
for that revision.
NO-COMMENT non-nil with zero or one revisions marked also means don't
prompt to edit the log message.
REVERSE non-nil means to undo the effects of the revisions, instead.
INTERACTIVE and DELETE are passed on to vc--pick-or-revert, except
additionally if INTERACTIVE is non-nil and vc--pick-or-revert returns
deleted, pass no-confirm to subsequent calls to that function.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/log-view.el.gz
(defun log-view--pick-or-revert
(directory no-comment reverse interactive delete)
"Copy changes from revision at point or all marked revisions.
DIRECTORY is the destination, the root of the target working tree.
NO-COMMENT non-nil means use the log messages of the revisions
unmodified, instead of using the backend's default cherry-pick comment
for that revision.
NO-COMMENT non-nil with zero or one revisions marked also means don't
prompt to edit the log message.
REVERSE non-nil means to undo the effects of the revisions, instead.
INTERACTIVE and DELETE are passed on to `vc--pick-or-revert', except
additionally if INTERACTIVE is non-nil and `vc--pick-or-revert' returns
`deleted', pass `no-confirm' to subsequent calls to that function."
(let ((default-directory directory)
(marked (log-view-get-marked))
(buf (current-buffer)))
(if (length> marked 1)
(let ((deleted 0))
(save-excursion
(dolist (rev (if reverse (reverse marked) marked))
;; Unmark each revision *before* copying it.
;; Then if there is a conflict such that a cherry-pick
;; fails, after resolving that conflict and committing the
;; cherry-pick, the right revisions will be marked to
;; resume the original multiple cherry-pick operation.
;; FIXME: This doesn't work so long as the backend
;; functions just give up completely if there is a
;; conflict (which behavior is also a FIXME). Then in
;; fact the user has to mark the revision again.
(log-view-goto-rev rev)
(log-view-unmark-entry 1)
(cl-case
(vc--pick-or-revert rev reverse interactive delete
(if no-comment
(vc-call-backend log-view-vc-backend
'get-change-comment
nil rev)
t)
nil
log-view-vc-backend)
(deleted (incf deleted)
(when interactive
(setq interactive 'no-confirm))))))
(let ((new-commits (- (length marked) deleted)))
(when (and (plusp new-commits)
(vc-find-backend-function log-view-vc-backend
'modify-change-comment))
(let (vc-log-short-style)
(vc-print-log-internal log-view-vc-backend
(list default-directory)
nil nil new-commits))
(setq-local vc-log-short-style nil ; For \\`g'.
vc-parent-buffer-name nil)
(message (substitute-command-keys "Use \
\\[log-view-modify-change-comment] to modify any of these messages")))))
(let ((rev (or (car marked) (log-view-current-tag))))
(vc--pick-or-revert rev reverse interactive delete
(and no-comment
(vc-call-backend log-view-vc-backend
'get-change-comment
nil rev))
nil
log-view-vc-backend)))
(when (eq (current-buffer) buf)
(revert-buffer))))