Function: vc-finish-logentry
vc-finish-logentry is an interactive and byte-compiled function
defined in vc-dispatcher.el.gz.
Signature
(vc-finish-logentry &optional NOCOMMENT)
Documentation
Complete the operation implied by the current log entry.
Use the contents of the current buffer as a check-in or registration comment. If the optional arg NOCOMMENT is non-nil, then don't check the buffer contents as a comment.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
;; vc-finish-logentry is typically called from a log-edit buffer (see
;; vc-start-logentry).
(defun vc-finish-logentry (&optional nocomment)
"Complete the operation implied by the current log entry.
Use the contents of the current buffer as a check-in or registration
comment. If the optional arg NOCOMMENT is non-nil, then don't check
the buffer contents as a comment."
(interactive)
;; Check and record the comment, if any.
(unless nocomment
(run-hooks 'vc-logentry-check-hook))
(unless vc-log-operation
(error "No log operation is pending"))
;; save the parameters held in buffer-local variables
(let ((logbuf (current-buffer))
(log-operation vc-log-operation)
(log-fileset vc-log-fileset)
(log-entry (buffer-string))
(after-hook vc-log-after-operation-hook)
(parent vc-parent-buffer))
;; OK, do it to it
(let* ((log-operation-ret
(with-current-buffer parent
(let ((vc--inhibit-async-window t))
(funcall log-operation log-fileset log-entry))))
(asyncp (eq (car-safe log-operation-ret) 'async)))
(pop-to-buffer parent)
(setq vc-log-operation nil)
;; Quit windows on logbuf.
(cond ((not logbuf))
(vc-delete-logbuf-window
(quit-windows-on logbuf t (selected-frame)))
(t
(quit-windows-on logbuf nil 0)))
(when (and asyncp
;; For an async commit, if we will display the buffer
;; if the command fails, don't display it sooner.
;; The output from successful commit commands isn't
;; interesting and VC-Dir will show the files as being
;; committed while it's in progress.
(not vc-display-failed-async-commands))
(vc--display-async-command-buffer (process-buffer
(cadr log-operation-ret))))
;; Now make sure we see the expanded headers.
;; If the `vc-log-operation' started an async operation then we
;; need to delay running the hooks. It tells us whether it did
;; that with a special return value.
(cl-flet ((resynch-and-hooks ()
(when (buffer-live-p parent)
(with-current-buffer parent
(mapc (lambda (file)
;; Maybe we should pass `unless-modified'
;; unconditionally here. Currently we do
;; so in the async case to fix bug#81453,
;; and leave the synchronous case the same
;; to preserve old behavior.
(vc-resynch-buffer file t (if asyncp
'unless-modified
t)))
log-fileset)
(run-hooks after-hook 'vc-finish-logentry-hook)))))
(if asyncp
(vc-exec-after #'resynch-and-hooks nil (cadr log-operation-ret))
(resynch-and-hooks))))))