Function: vc-print-log-renamed-add-button

vc-print-log-renamed-add-button is a byte-compiled function defined in vc.el.gz.

Signature

(vc-print-log-renamed-add-button RENAMED-FILES BACKEND CURRENT-FILESET CURRENT-REVISION REVISION LIMIT)

Documentation

Print the button for jump to the log for a different fileset.

RENAMED-FILES is the fileset to use. BACKEND is the VC backend. REVISION is the revision from which to start the new log. CURRENT-FILESET, if non-nil, is the fileset to use in the "back" button for. Same for CURRENT-REVISION. LIMIT means the usual.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-print-log-renamed-add-button ( renamed-files backend
                                         current-fileset
                                         current-revision
                                         revision limit)
  "Print the button for jump to the log for a different fileset.
RENAMED-FILES is the fileset to use.  BACKEND is the VC backend.
REVISION is the revision from which to start the new log.
CURRENT-FILESET, if non-nil, is the fileset to use in the \"back\"
button for.  Same for CURRENT-REVISION.  LIMIT means the usual."
  (let ((relatives (mapcar #'file-relative-name renamed-files))
        (from-to (if current-fileset "from" "to"))
        (before-after (if current-fileset "before" "after")))
    (insert
     (format
      "Renamed %s %s"
      from-to
      (mapconcat (lambda (s)
                   (propertize s 'font-lock-face
                               'log-view-file))
                 relatives
                 ", "))
     " ")
    (insert-text-button
     "View log"
     'action (lambda (&rest _ignore)
               ;; To set up parent buffer in the new viewer.
               (with-current-buffer vc-parent-buffer
                 (let ((log-view-vc-prev-fileset current-fileset)
                       (log-view-vc-prev-revision current-revision))
                   (vc-print-log-internal backend renamed-files
                                          revision t limit))))
     ;; XXX: Showing the full history for OLD-NAMES (with
     ;; IS-START-REVISION=nil) can be better sometimes
     ;; (e.g. when some edits still occurred after a rename
     ;; -- multiple branches scenario), but it also can hurt
     ;; in others because of Git's automatic history
     ;; simplification: as a result, the logs for some
     ;; use-package's files before merge could not be found.
     'help-echo
     (format
      "Show the log for the file name(s) %s the rename"
      before-after))))