Function: vc-annotate-warp-revision
vc-annotate-warp-revision is a byte-compiled function defined in
vc-annotate.el.gz.
Signature
(vc-annotate-warp-revision REVSPEC &optional FILE)
Documentation
Annotate the revision described by REVSPEC.
If REVSPEC is a positive integer, warp that many revisions forward, if possible, otherwise echo a warning message. If REVSPEC is a negative integer, warp that many revisions backward, if possible, otherwise echo a warning message. If REVSPEC is a string, then it describes a revision number, so warp to that revision.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-annotate.el.gz
(defun vc-annotate-warp-revision (revspec &optional file)
"Annotate the revision described by REVSPEC.
If REVSPEC is a positive integer, warp that many revisions forward,
if possible, otherwise echo a warning message. If REVSPEC is a
negative integer, warp that many revisions backward, if possible,
otherwise echo a warning message. If REVSPEC is a string, then it
describes a revision number, so warp to that revision."
(if (not (equal major-mode 'vc-annotate-mode))
(message "Cannot be invoked outside of a vc annotate buffer")
(let* ((buf (current-buffer))
(oldline (line-number-at-pos))
(revspeccopy revspec)
(newrev nil))
(cond
((and (integerp revspec) (> revspec 0))
(setq newrev vc-buffer-revision)
(let ((vc-use-short-revision vc-annotate-use-short-revision))
(while (and (> revspec 0) newrev)
(setq newrev
(vc-call-backend vc-annotate-backend 'next-revision
(or file
(caadr vc-buffer-overriding-fileset))
newrev))
(setq file (vc-annotate--file-name-change
(or file
(caadr vc-buffer-overriding-fileset))
newrev
vc-annotate-backend))
(setq revspec (1- revspec))))
(unless newrev
(message "Cannot increment %d revisions from revision %s"
revspeccopy vc-buffer-revision)))
((and (integerp revspec) (< revspec 0))
(setq newrev vc-buffer-revision)
(let ((vc-use-short-revision vc-annotate-use-short-revision))
(while (and (< revspec 0) newrev)
(setq file (vc-annotate--file-name-change
(or file
(caadr vc-buffer-overriding-fileset))
newrev
vc-annotate-backend
'backward))
(setq newrev
(vc-call-backend vc-annotate-backend 'previous-revision
(or file
(caadr vc-buffer-overriding-fileset))
newrev))
(setq revspec (1+ revspec))))
(unless newrev
(message "Cannot decrement %d revisions from revision %s"
(- 0 revspeccopy) vc-buffer-revision)))
((stringp revspec) (setq newrev revspec))
(t (error "Invalid argument to vc-annotate-warp-revision")))
(when newrev
(vc-annotate (or file
(caadr vc-buffer-overriding-fileset))
newrev
vc-annotate-parent-display-mode
buf
;; Pass the current line so that vc-annotate will
;; place the point in the line.
(min oldline (progn (goto-char (point-max))
(forward-line -1)
(line-number-at-pos)))
vc-annotate-backend)))))