diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2009-12-07 09:02:11 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2009-12-07 09:02:11 +0000 |
commit | 662c5698fb07b4e280ef548375c703c1d03455c0 (patch) | |
tree | 7181cc811c24f419d5d39ab2360b9a0e40118c59 /lisp/vc.el | |
parent | 2de386ca1d481a544e6fed79baaa19adcc80161d (diff) | |
download | emacs-662c5698fb07b4e280ef548375c703c1d03455c0.tar.gz emacs-662c5698fb07b4e280ef548375c703c1d03455c0.tar.bz2 emacs-662c5698fb07b4e280ef548375c703c1d03455c0.zip |
Support showing a single log entry from vc-annotate.
* vc.el (print-log): Add a new argument: START-REVISION.
(vc-print-log-internal): Add a new optional argument and
pass it to the backend.
(vc-print-log, vc-print-root-log): Adjust callers.
* vc-annotate.el (vc-annotate-show-log-revision-at-line): If a
buffer already displays the requested log entry, use it.
Otherwise display only the log entry in question.
* vc-svn.el (vc-svn-print-log):
* vc-mtn.el (log-view-file-re):
* vc-hg.el (vc-hg-state):
* vc-git.el (vc-git-print-log): Add support for new argument START-REVISION.
(vc-git-show-log-entry): Return t on success.
* vc-bzr.el (vc-bzr-print-log): Add support new argument START-REVISION.
(vc-bzr-show-log-entry): Return t on success.
* vc-rcs.el (vc-rcs-print-log):
* vc-sccs.el (vc-sccs-print-log):
* vc-cvs.el (vc-cvs-print-log): Add new argument, ignore it.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r-- | lisp/vc.el | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index cd9f11bcf3a..9a71286d685 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -333,13 +333,16 @@ ;; ;; HISTORY FUNCTIONS ;; -;; * print-log (files buffer &optional shortlog limit) +;; * print-log (files buffer &optional shortlog start-revision limit) ;; ;; Insert the revision log for FILES into BUFFER. ;; If SHORTLOG is true insert a short version of the log. ;; If LIMIT is true insert only insert LIMIT log entries. If the ;; backend does not support limiting the number of entries to show ;; it should return `limit-unsupported'. +;; If START-REVISION is given, then show the log starting from the +;; revision. At this point START-REVISION is only required to work +;; in conjunction with LIMIT = 1. ;; ;; - log-view-mode () ;; @@ -1863,7 +1866,7 @@ Not all VC backends support short logs!") (defvar log-view-vc-fileset) (defun vc-print-log-internal (backend files working-revision - &optional limit) + &optional is-start-revision limit) ;; Don't switch to the output buffer before running the command, ;; so that any buffer-local settings in the vc-controlled ;; buffer can be accessed by the command. @@ -1878,8 +1881,9 @@ Not all VC backends support short logs!") (memq 'directory vc-log-short-style) (memq 'file vc-log-short-style))))) - (setq pl-return (vc-call-backend backend 'print-log files "*vc-change-log*" - vc-short-log limit)) + (setq pl-return (vc-call-backend + backend 'print-log files "*vc-change-log*" + vc-short-log (when is-start-revision working-revision) limit)) (pop-to-buffer "*vc-change-log*") (let ((inhibit-read-only t)) ;; log-view-mode used to be called with inhibit-read-only bound @@ -1890,19 +1894,20 @@ Not all VC backends support short logs!") (vc-exec-after `(let ((inhibit-read-only t)) - (when (and ,limit (not ,(eq 'limit-unsupported pl-return))) + (when (and ,limit (not ,(eq 'limit-unsupported pl-return)) + (not ,is-start-revision)) (goto-char (point-max)) (widget-create 'push-button :notify (lambda (&rest ignore) (vc-print-log-internal - ',backend ',files ',working-revision (* 2 ,limit))) + ',backend ',files ',working-revision nil (* 2 ,limit))) :help-echo "Show the log again, and double the number of log entries shown" "Show 2X entries") (widget-insert " ") (widget-create 'push-button :notify (lambda (&rest ignore) (vc-print-log-internal - ',backend ',files ',working-revision nil)) + ',backend ',files ',working-revision nil nil)) :help-echo "Show the log again, showing all entries" "Show unlimited entries") (widget-setup)) @@ -1936,7 +1941,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision." (backend (car vc-fileset)) (files (cadr vc-fileset)) (working-revision (or working-revision (vc-working-revision (car files))))) - (vc-print-log-internal backend files working-revision limit))) + (vc-print-log-internal backend files working-revision nil limit))) ;;;###autoload (defun vc-print-root-log (&optional limit) @@ -1962,7 +1967,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision." (error "Buffer is not version controlled")) (setq rootdir (vc-call-backend backend 'root default-directory)) (setq working-revision (vc-working-revision rootdir)) - (vc-print-log-internal backend (list rootdir) working-revision limit))) + (vc-print-log-internal backend (list rootdir) working-revision nil limit))) ;;;###autoload (defun vc-revert () |