Function: vc-print-root-log

vc-print-root-log is an autoloaded, interactive and byte-compiled function defined in vc.el.gz.

Signature

(vc-print-root-log &optional LIMIT REVISION)

Documentation

Show in another window VC change history of the current VC controlled tree.

If LIMIT is non-nil, it should be a number specifying the maximum number of revisions to show; the default is vc-log-show-limit. When called interactively with a prefix argument, prompt for LIMIT, but if the prefix argument is a number, use it as LIMIT. A special case is when the prefix argument is 1: in this case the command prompts for the ID of a revision, and shows that revision with its diffs (if the underlying VCS backend supports that).

View in manual

Probably introduced at or before Emacs version 24.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-print-root-log (&optional limit revision)
  "Show in another window VC change history of the current VC controlled tree.
If LIMIT is non-nil, it should be a number specifying the maximum
number of revisions to show; the default is `vc-log-show-limit'.
When called interactively with a prefix argument, prompt for LIMIT, but
if the prefix argument is a number, use it as LIMIT.
A special case is when the prefix argument is 1: in this case
the command prompts for the ID of a revision, and shows that revision
with its diffs (if the underlying VCS backend supports that)."
  (interactive
   (cond
    ((eq current-prefix-arg 1)
     (let* ((default (thing-at-point 'word t))
	    (revision (read-string (format-prompt "Revision to show" default)
                                   nil nil default)))
       (list 1 revision)))
    ((numberp current-prefix-arg)
     (list current-prefix-arg))
    (current-prefix-arg
     (let ((lim (string-to-number
		 (read-from-minibuffer
		  "Limit display (unlimited: 0): "
		  (format "%s" vc-log-show-limit)
		  nil nil nil))))
       (when (<= lim 0) (setq lim nil))
       (list lim)))
    (t
     (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
  (let* ((backend (vc-deduce-backend))
	 (default-directory default-directory)
	 (with-diff (and (eq limit 1) revision))
	 (vc-log-short-style (unless with-diff vc-log-short-style))
	 rootdir)
    (if backend
	(setq rootdir (vc-call-backend backend 'root default-directory))
      (setq rootdir (read-directory-name "Directory for VC revision log: "))
      (setq backend (vc-responsible-backend rootdir))
      (unless backend
        (error "Directory is not version controlled")))
    (setq default-directory rootdir)
    (vc-print-log-internal backend (list rootdir) revision revision limit
                           (when with-diff 'with-diff))
    ;; We're looking at the root, so displaying " from <some-file>" in
    ;; the mode line isn't helpful.
    (setq vc-parent-buffer-name nil)))