diff options
| author | Dan Nicolaescu | 2009-12-07 09:02:11 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-12-07 09:02:11 +0000 |
| commit | 662c5698fb07b4e280ef548375c703c1d03455c0 (patch) | |
| tree | 7181cc811c24f419d5d39ab2360b9a0e40118c59 | |
| parent | 2de386ca1d481a544e6fed79baaa19adcc80161d (diff) | |
| download | emacs-662c5698fb07b4e280ef548375c703c1d03455c0.tar.gz 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.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 35 | ||||
| -rw-r--r-- | lisp/vc-annotate.el | 28 | ||||
| -rw-r--r-- | lisp/vc-bzr.el | 13 | ||||
| -rw-r--r-- | lisp/vc-cvs.el | 2 | ||||
| -rw-r--r-- | lisp/vc-git.el | 24 | ||||
| -rw-r--r-- | lisp/vc-hg.el | 13 | ||||
| -rw-r--r-- | lisp/vc-mtn.el | 6 | ||||
| -rw-r--r-- | lisp/vc-rcs.el | 2 | ||||
| -rw-r--r-- | lisp/vc-sccs.el | 2 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 25 | ||||
| -rw-r--r-- | lisp/vc.el | 23 |
12 files changed, 126 insertions, 51 deletions
| @@ -267,6 +267,10 @@ it displays the old names for the files and it can show logs/diffs for | |||
| 267 | the corresponding lines. Currently only Git and Mercurial take | 267 | the corresponding lines. Currently only Git and Mercurial take |
| 268 | advantage of this feature. | 268 | advantage of this feature. |
| 269 | 269 | ||
| 270 | *** The log command in vc-annotate can display a single log entry | ||
| 271 | instead of redisplaying the full log. The RCS, CVS and SCCS VC | ||
| 272 | backends do not support this. | ||
| 273 | |||
| 270 | *** When a file is not found, VC will not try to check it out of RCS anymore. | 274 | *** When a file is not found, VC will not try to check it out of RCS anymore. |
| 271 | 275 | ||
| 272 | *** Diff and log operations can be used from dired buffers. | 276 | *** Diff and log operations can be used from dired buffers. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be160bf9abe..0d0be747b87 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,13 +1,34 @@ | |||
| 1 | 2009-12-07 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Support showing a single log entry from vc-annotate. | ||
| 4 | * vc.el (print-log): Add a new argument: START-REVISION. | ||
| 5 | (vc-print-log-internal): Add a new optional argument and | ||
| 6 | pass it to the backend. | ||
| 7 | (vc-print-log, vc-print-root-log): Adjust callers. | ||
| 8 | * vc-annotate.el (vc-annotate-show-log-revision-at-line): If a | ||
| 9 | buffer already displays the requested log entry, use it. | ||
| 10 | Otherwise display only the log entry in question. | ||
| 11 | * vc-svn.el (vc-svn-print-log): | ||
| 12 | * vc-mtn.el (log-view-file-re): | ||
| 13 | * vc-hg.el (vc-hg-state): | ||
| 14 | * vc-git.el (vc-git-print-log): Add support for new argument START-REVISION. | ||
| 15 | (vc-git-show-log-entry): Return t on success. | ||
| 16 | * vc-bzr.el (vc-bzr-print-log): Add support new argument START-REVISION. | ||
| 17 | (vc-bzr-show-log-entry): Return t on success. | ||
| 18 | * vc-rcs.el (vc-rcs-print-log): | ||
| 19 | * vc-sccs.el (vc-sccs-print-log): | ||
| 20 | * vc-cvs.el (vc-cvs-print-log): Add new argument, ignore it. | ||
| 21 | |||
| 1 | 2009-12-07 Michael Kifer <kifer@cs.stonybrook.edu> | 22 | 2009-12-07 Michael Kifer <kifer@cs.stonybrook.edu> |
| 2 | 23 | ||
| 3 | * ediff-init.el (ediff-event-key): use event-to-character instead of | 24 | * ediff-init.el (ediff-event-key): Use event-to-character instead of |
| 4 | event-key. | 25 | event-key. |
| 5 | 26 | ||
| 6 | * ediff-mult.el (ediff-setup-meta-map, ediff-prepare-meta-buffer): add | 27 | * ediff-mult.el (ediff-setup-meta-map, ediff-prepare-meta-buffer): Add |
| 7 | menus to the meta mode. (Dan Nicolaescu's <dann@ics.uci.edu> patch.) | 28 | menus to the meta mode. (Dan Nicolaescu's <dann@ics.uci.edu> patch.) |
| 8 | 29 | ||
| 9 | * ediff.el (ediff-buffers-internal): add unwind-protect. | 30 | * ediff.el (ediff-buffers-internal): Add unwind-protect. |
| 10 | 31 | ||
| 11 | 2009-12-07 Michael Albinus <michael.albinus@gmx.de> | 32 | 2009-12-07 Michael Albinus <michael.albinus@gmx.de> |
| 12 | 33 | ||
| 13 | Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphaël | 34 | Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphaël |
diff --git a/lisp/vc-annotate.el b/lisp/vc-annotate.el index 122aec982ca..9f4592334a1 100644 --- a/lisp/vc-annotate.el +++ b/lisp/vc-annotate.el | |||
| @@ -479,15 +479,37 @@ Return a cons (REV . FILENAME)." | |||
| 479 | (vc-annotate-warp-revision prev-rev fname))))) | 479 | (vc-annotate-warp-revision prev-rev fname))))) |
| 480 | 480 | ||
| 481 | (defun vc-annotate-show-log-revision-at-line () | 481 | (defun vc-annotate-show-log-revision-at-line () |
| 482 | "Visit the log of the revision at line." | 482 | "Visit the log of the revision at line. |
| 483 | If the VC backend supports it, only show the log entry for the revision. | ||
| 484 | If a *vc-change-log* buffer exists and already shows a log for | ||
| 485 | the file in question, search for the log entry required and move point ." | ||
| 483 | (interactive) | 486 | (interactive) |
| 484 | (if (not (equal major-mode 'vc-annotate-mode)) | 487 | (if (not (equal major-mode 'vc-annotate-mode)) |
| 485 | (message "Cannot be invoked outside of a vc annotate buffer") | 488 | (message "Cannot be invoked outside of a vc annotate buffer") |
| 486 | (let ((rev-at-line (vc-annotate-extract-revision-at-line))) | 489 | (let ((rev-at-line (vc-annotate-extract-revision-at-line))) |
| 487 | (if (not rev-at-line) | 490 | (if (not rev-at-line) |
| 488 | (message "Cannot extract revision number from the current line") | 491 | (message "Cannot extract revision number from the current line") |
| 489 | (vc-print-log-internal | 492 | (let ((backend vc-annotate-backend) |
| 490 | vc-annotate-backend (list (cdr rev-at-line)) (car rev-at-line) nil))))) | 493 | (log-buf (get-buffer "*vc-change-log*")) |
| 494 | pos) | ||
| 495 | (if (and | ||
| 496 | log-buf | ||
| 497 | ;; Look for a log buffer that already displays the correct file. | ||
| 498 | (with-current-buffer log-buf | ||
| 499 | (and (eq backend log-view-vc-backend) | ||
| 500 | (null (cdr log-view-vc-fileset)) | ||
| 501 | (string= (car log-view-vc-fileset) (cdr rev-at-line)) | ||
| 502 | ;; Check if the entry we require can be found. | ||
| 503 | (vc-call-backend | ||
| 504 | backend 'show-log-entry (car rev-at-line)) | ||
| 505 | (setq pos (point))))) | ||
| 506 | (progn | ||
| 507 | (pop-to-buffer log-buf) | ||
| 508 | (goto-char pos)) | ||
| 509 | ;; Ask the backend to display a single log entry. | ||
| 510 | (vc-print-log-internal | ||
| 511 | vc-annotate-backend (list (cdr rev-at-line)) | ||
| 512 | (car rev-at-line) t 1))))))) | ||
| 491 | 513 | ||
| 492 | (defun vc-annotate-show-diff-revision-at-line-internal (filediff) | 514 | (defun vc-annotate-show-diff-revision-at-line-internal (filediff) |
| 493 | (if (not (equal major-mode 'vc-annotate-mode)) | 515 | (if (not (equal major-mode 'vc-annotate-mode)) |
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 70989ee56e7..ef12f19d2de 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -481,7 +481,7 @@ REV non-nil gets an error." | |||
| 481 | (2 'change-log-email)) | 481 | (2 'change-log-email)) |
| 482 | ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face))))))) | 482 | ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face))))))) |
| 483 | 483 | ||
| 484 | (defun vc-bzr-print-log (files buffer &optional shortlog limit) | 484 | (defun vc-bzr-print-log (files buffer &optional shortlog start-revision limit) |
| 485 | "Get bzr change log for FILES into specified BUFFER." | 485 | "Get bzr change log for FILES into specified BUFFER." |
| 486 | ;; `vc-do-command' creates the buffer, but we need it before running | 486 | ;; `vc-do-command' creates the buffer, but we need it before running |
| 487 | ;; the command. | 487 | ;; the command. |
| @@ -495,6 +495,7 @@ REV non-nil gets an error." | |||
| 495 | (apply 'vc-bzr-command "log" buffer 'async files | 495 | (apply 'vc-bzr-command "log" buffer 'async files |
| 496 | (append | 496 | (append |
| 497 | (when shortlog '("--short")) | 497 | (when shortlog '("--short")) |
| 498 | (when start-revision (list (format "-r..%s" start-revision))) | ||
| 498 | (when limit (list "-l" (format "%s" limit))) | 499 | (when limit (list "-l" (format "%s" limit))) |
| 499 | (if (stringp vc-bzr-log-switches) | 500 | (if (stringp vc-bzr-log-switches) |
| 500 | (list vc-bzr-log-switches) | 501 | (list vc-bzr-log-switches) |
| @@ -504,7 +505,8 @@ REV non-nil gets an error." | |||
| 504 | "Find entry for patch name REVISION in bzr change log buffer." | 505 | "Find entry for patch name REVISION in bzr change log buffer." |
| 505 | (goto-char (point-min)) | 506 | (goto-char (point-min)) |
| 506 | (when revision | 507 | (when revision |
| 507 | (let (case-fold-search) | 508 | (let (case-fold-search |
| 509 | found) | ||
| 508 | (if (re-search-forward | 510 | (if (re-search-forward |
| 509 | ;; "revno:" can appear either at the beginning of a line, | 511 | ;; "revno:" can appear either at the beginning of a line, |
| 510 | ;; or indented. | 512 | ;; or indented. |
| @@ -512,8 +514,11 @@ REV non-nil gets an error." | |||
| 512 | ;; The revision can contain ".", quote it so that it | 514 | ;; The revision can contain ".", quote it so that it |
| 513 | ;; does not interfere with regexp matching. | 515 | ;; does not interfere with regexp matching. |
| 514 | (regexp-quote revision) "$") nil t) | 516 | (regexp-quote revision) "$") nil t) |
| 515 | (beginning-of-line 0) | 517 | (progn |
| 516 | (goto-char (point-min)))))) | 518 | (beginning-of-line 0) |
| 519 | (setq found t)) | ||
| 520 | (goto-char (point-min))) | ||
| 521 | found))) | ||
| 517 | 522 | ||
| 518 | (defun vc-bzr-diff (files &optional rev1 rev2 buffer) | 523 | (defun vc-bzr-diff (files &optional rev1 rev2 buffer) |
| 519 | "VC bzr backend for diff." | 524 | "VC bzr backend for diff." |
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 39125328d0c..dcd23fe973b 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el | |||
| @@ -496,7 +496,7 @@ Will fail unless you have administrative privileges on the repo." | |||
| 496 | 496 | ||
| 497 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) | 497 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) |
| 498 | 498 | ||
| 499 | (defun vc-cvs-print-log (files buffer &optional shortlog limit) | 499 | (defun vc-cvs-print-log (files buffer &optional shortlog start-revision-ignored limit) |
| 500 | "Get change logs associated with FILES." | 500 | "Get change logs associated with FILES." |
| 501 | (require 'vc-rcs) | 501 | (require 'vc-rcs) |
| 502 | ;; It's just the catenation of the individual logs. | 502 | ;; It's just the catenation of the individual logs. |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index be466cba8bc..635c9d7cef9 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -77,7 +77,7 @@ | |||
| 77 | ;; - merge-news (file) see `merge' | 77 | ;; - merge-news (file) see `merge' |
| 78 | ;; - steal-lock (file &optional revision) NOT NEEDED | 78 | ;; - steal-lock (file &optional revision) NOT NEEDED |
| 79 | ;; HISTORY FUNCTIONS | 79 | ;; HISTORY FUNCTIONS |
| 80 | ;; * print-log (files buffer &optional shortlog limit) OK | 80 | ;; * print-log (files buffer &optional shortlog start-revision limit) OK |
| 81 | ;; - log-view-mode () OK | 81 | ;; - log-view-mode () OK |
| 82 | ;; - show-log-entry (revision) OK | 82 | ;; - show-log-entry (revision) OK |
| 83 | ;; - comment-history (file) ?? | 83 | ;; - comment-history (file) ?? |
| @@ -540,7 +540,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 540 | 540 | ||
| 541 | ;;; HISTORY FUNCTIONS | 541 | ;;; HISTORY FUNCTIONS |
| 542 | 542 | ||
| 543 | (defun vc-git-print-log (files buffer &optional shortlog limit) | 543 | (defun vc-git-print-log (files buffer &optional shortlog start-revision limit) |
| 544 | "Get change log associated with FILES." | 544 | "Get change log associated with FILES." |
| 545 | (let ((coding-system-for-read git-commits-coding-system)) | 545 | (let ((coding-system-for-read git-commits-coding-system)) |
| 546 | ;; `vc-do-command' creates the buffer, but we need it before running | 546 | ;; `vc-do-command' creates the buffer, but we need it before running |
| @@ -559,6 +559,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 559 | '("--graph" "--decorate" | 559 | '("--graph" "--decorate" |
| 560 | "--date=short" "--pretty=format:%d%h %ad %s" "--abbrev-commit")) | 560 | "--date=short" "--pretty=format:%d%h %ad %s" "--abbrev-commit")) |
| 561 | (when limit (list "-n" (format "%s" limit))) | 561 | (when limit (list "-n" (format "%s" limit))) |
| 562 | (when start-revision (list start-revision)) | ||
| 562 | '("--"))))))) | 563 | '("--"))))))) |
| 563 | 564 | ||
| 564 | (defvar log-view-message-re) | 565 | (defvar log-view-message-re) |
| @@ -615,14 +616,17 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 615 | REVISION may have the form BRANCH, BRANCH~N, | 616 | REVISION may have the form BRANCH, BRANCH~N, |
| 616 | or BRANCH^ (where \"^\" can be repeated)." | 617 | or BRANCH^ (where \"^\" can be repeated)." |
| 617 | (goto-char (point-min)) | 618 | (goto-char (point-min)) |
| 618 | (when revision | 619 | (let (found) |
| 619 | (search-forward (format "\ncommit %s" revision) nil t | 620 | (when revision |
| 620 | (cond ((string-match "~\\([0-9]\\)$" revision) | 621 | (setq found |
| 621 | (1+ (string-to-number (match-string 1 revision)))) | 622 | (search-forward (format "\ncommit %s" revision) nil t |
| 622 | ((string-match "\\^+$" revision) | 623 | (cond ((string-match "~\\([0-9]\\)$" revision) |
| 623 | (1+ (length (match-string 0 revision)))) | 624 | (1+ (string-to-number (match-string 1 revision)))) |
| 624 | (t nil)))) | 625 | ((string-match "\\^+$" revision) |
| 625 | (beginning-of-line)) | 626 | (1+ (length (match-string 0 revision)))) |
| 627 | (t nil))))) | ||
| 628 | (beginning-of-line) | ||
| 629 | found)) | ||
| 626 | 630 | ||
| 627 | (defun vc-git-diff (files &optional rev1 rev2 buffer) | 631 | (defun vc-git-diff (files &optional rev1 rev2 buffer) |
| 628 | "Get a difference report using Git between two revisions of FILES." | 632 | "Get a difference report using Git between two revisions of FILES." |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index ab4bdab8c50..1e01d50a670 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | ;; - merge-news (file) NEEDED | 68 | ;; - merge-news (file) NEEDED |
| 69 | ;; - steal-lock (file &optional revision) NOT NEEDED | 69 | ;; - steal-lock (file &optional revision) NOT NEEDED |
| 70 | ;; HISTORY FUNCTIONS | 70 | ;; HISTORY FUNCTIONS |
| 71 | ;; * print-log (files buffer &optional shortlog) OK | 71 | ;; * print-log (files buffer &optional shortlog start-revision limit) OK |
| 72 | ;; - log-view-mode () OK | 72 | ;; - log-view-mode () OK |
| 73 | ;; - show-log-entry (revision) NOT NEEDED, DEFAULT IS GOOD | 73 | ;; - show-log-entry (revision) NOT NEEDED, DEFAULT IS GOOD |
| 74 | ;; - comment-history (file) NOT NEEDED | 74 | ;; - comment-history (file) NOT NEEDED |
| @@ -167,9 +167,13 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 167 | (setq status | 167 | (setq status |
| 168 | (condition-case nil | 168 | (condition-case nil |
| 169 | ;; Ignore all errors. | 169 | ;; Ignore all errors. |
| 170 | (process-file | 170 | (let ((process-environment |
| 171 | ;; Avoid localization of messages so we can parse the output. | ||
| 172 | (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") process-environment))) | ||
| 173 | |||
| 174 | (process-file | ||
| 171 | "hg" nil t nil | 175 | "hg" nil t nil |
| 172 | "status" "-A" (file-relative-name file)) | 176 | "status" "-A" (file-relative-name file))) |
| 173 | ;; Some problem happened. E.g. We can't find an `hg' | 177 | ;; Some problem happened. E.g. We can't find an `hg' |
| 174 | ;; executable. | 178 | ;; executable. |
| 175 | (error nil))))))) | 179 | (error nil))))))) |
| @@ -219,7 +223,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 219 | (repeat :tag "Argument List" :value ("") string)) | 223 | (repeat :tag "Argument List" :value ("") string)) |
| 220 | :group 'vc-hg) | 224 | :group 'vc-hg) |
| 221 | 225 | ||
| 222 | (defun vc-hg-print-log (files buffer &optional shortlog limit) | 226 | (defun vc-hg-print-log (files buffer &optional shortlog limit start-revision) |
| 223 | "Get change log associated with FILES." | 227 | "Get change log associated with FILES." |
| 224 | ;; `vc-do-command' creates the buffer, but we need it before running | 228 | ;; `vc-do-command' creates the buffer, but we need it before running |
| 225 | ;; the command. | 229 | ;; the command. |
| @@ -231,6 +235,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 231 | buffer | 235 | buffer |
| 232 | (apply 'vc-hg-command buffer 0 files "log" | 236 | (apply 'vc-hg-command buffer 0 files "log" |
| 233 | (append | 237 | (append |
| 238 | (when start-revision (list (format "-r%s:" start-revision))) | ||
| 234 | (when limit (list "-l" (format "%s" limit))) | 239 | (when limit (list "-l" (format "%s" limit))) |
| 235 | (when shortlog '("--style" "compact")) | 240 | (when shortlog '("--style" "compact")) |
| 236 | vc-hg-log-switches))))) | 241 | vc-hg-log-switches))))) |
diff --git a/lisp/vc-mtn.el b/lisp/vc-mtn.el index 05be5c8ef11..dc745811cd8 100644 --- a/lisp/vc-mtn.el +++ b/lisp/vc-mtn.el | |||
| @@ -188,9 +188,11 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 188 | ;; (defun vc-mtn-roolback (files) | 188 | ;; (defun vc-mtn-roolback (files) |
| 189 | ;; ) | 189 | ;; ) |
| 190 | 190 | ||
| 191 | (defun vc-mtn-print-log (files buffer &optional shortlog limit) | 191 | (defun vc-mtn-print-log (files buffer &optional shortlog start-revision limit) |
| 192 | (apply 'vc-mtn-command buffer 0 files "log" | 192 | (apply 'vc-mtn-command buffer 0 files "log" |
| 193 | (when limit (list "--last" (format "%s" limit))))) | 193 | (append |
| 194 | (when start-revision (list "--from" (format "%s" start-revision)) | ||
| 195 | (when limit (list "--last" (format "%s" limit))))))) | ||
| 194 | 196 | ||
| 195 | (defvar log-view-message-re) | 197 | (defvar log-view-message-re) |
| 196 | (defvar log-view-file-re) | 198 | (defvar log-view-file-re) |
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el index 38573e412d9..e5b624db945 100644 --- a/lisp/vc-rcs.el +++ b/lisp/vc-rcs.el | |||
| @@ -559,7 +559,7 @@ directory the operation is applied to all registered files beneath it." | |||
| 559 | (when (looking-at "[\b\t\n\v\f\r ]+") | 559 | (when (looking-at "[\b\t\n\v\f\r ]+") |
| 560 | (delete-char (- (match-end 0) (match-beginning 0)))))) | 560 | (delete-char (- (match-end 0) (match-beginning 0)))))) |
| 561 | 561 | ||
| 562 | (defun vc-rcs-print-log (files buffer &optional shortlog limit) | 562 | (defun vc-rcs-print-log (files buffer &optional shortlog start-revision-ignored limit) |
| 563 | "Get change log associated with FILE. If FILE is a | 563 | "Get change log associated with FILE. If FILE is a |
| 564 | directory the operation is applied to all registered files beneath it." | 564 | directory the operation is applied to all registered files beneath it." |
| 565 | (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs files))) | 565 | (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs files))) |
diff --git a/lisp/vc-sccs.el b/lisp/vc-sccs.el index 2dda128bc14..f0aadd0ff79 100644 --- a/lisp/vc-sccs.el +++ b/lisp/vc-sccs.el | |||
| @@ -335,7 +335,7 @@ revert all subfiles." | |||
| 335 | ;;; History functions | 335 | ;;; History functions |
| 336 | ;;; | 336 | ;;; |
| 337 | 337 | ||
| 338 | (defun vc-sccs-print-log (files buffer &optional shortlog limit) | 338 | (defun vc-sccs-print-log (files buffer &optional shortlog start-revision-ignored limit) |
| 339 | "Get change log associated with FILES." | 339 | "Get change log associated with FILES." |
| 340 | (setq files (vc-expand-dirs files)) | 340 | (setq files (vc-expand-dirs files)) |
| 341 | (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-name files)) | 341 | (vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-name files)) |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index fb62979adaa..3c7e2730df9 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -462,7 +462,7 @@ or svn+ssh://." | |||
| 462 | (require 'add-log) | 462 | (require 'add-log) |
| 463 | (set (make-local-variable 'log-view-per-file-logs) nil)) | 463 | (set (make-local-variable 'log-view-per-file-logs) nil)) |
| 464 | 464 | ||
| 465 | (defun vc-svn-print-log (files buffer &optional shortlog limit) | 465 | (defun vc-svn-print-log (files buffer &optional shortlog start-revision limit) |
| 466 | "Get change log(s) associated with FILES." | 466 | "Get change log(s) associated with FILES." |
| 467 | (save-current-buffer | 467 | (save-current-buffer |
| 468 | (vc-setup-buffer buffer) | 468 | (vc-setup-buffer buffer) |
| @@ -478,15 +478,22 @@ or svn+ssh://." | |||
| 478 | ;; (if (and (= (length files) 1) (vc-stay-local-p file 'SVN)) 'async 0) | 478 | ;; (if (and (= (length files) 1) (vc-stay-local-p file 'SVN)) 'async 0) |
| 479 | (list file) | 479 | (list file) |
| 480 | "log" | 480 | "log" |
| 481 | ;; By default Subversion only shows the log up to the | 481 | (append |
| 482 | ;; working revision, whereas we also want the log of the | 482 | (list |
| 483 | ;; subsequent commits. At least that's what the | 483 | (if start-revision |
| 484 | ;; vc-cvs.el code does. | 484 | (format "-r%s" start-revision) |
| 485 | "-rHEAD:0" | 485 | ;; By default Subversion only shows the log up to the |
| 486 | (when limit (list "-l" (format "%s" limit))))) | 486 | ;; working revision, whereas we also want the log of the |
| 487 | ;; subsequent commits. At least that's what the | ||
| 488 | ;; vc-cvs.el code does. | ||
| 489 | "-rHEAD:0")) | ||
| 490 | (when limit (list "-l" (format "%s" limit)))))) | ||
| 487 | ;; Dump log for the entire directory. | 491 | ;; Dump log for the entire directory. |
| 488 | (apply 'vc-svn-command buffer 0 nil "log" "-rHEAD:0" | 492 | (apply 'vc-svn-command buffer 0 nil "log" |
| 489 | (when limit (list "-l" (format "%s" limit)))))))) | 493 | (append |
| 494 | (list | ||
| 495 | (if start-revision (format "-r%s" start-revision) "-rHEAD:0")) | ||
| 496 | (when limit (list "-l" (format "%s" limit))))))))) | ||
| 490 | 497 | ||
| 491 | (defun vc-svn-diff (files &optional oldvers newvers buffer) | 498 | (defun vc-svn-diff (files &optional oldvers newvers buffer) |
| 492 | "Get a difference report using SVN between two revisions of fileset FILES." | 499 | "Get a difference report using SVN between two revisions of fileset FILES." |
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 @@ | |||
| 333 | ;; | 333 | ;; |
| 334 | ;; HISTORY FUNCTIONS | 334 | ;; HISTORY FUNCTIONS |
| 335 | ;; | 335 | ;; |
| 336 | ;; * print-log (files buffer &optional shortlog limit) | 336 | ;; * print-log (files buffer &optional shortlog start-revision limit) |
| 337 | ;; | 337 | ;; |
| 338 | ;; Insert the revision log for FILES into BUFFER. | 338 | ;; Insert the revision log for FILES into BUFFER. |
| 339 | ;; If SHORTLOG is true insert a short version of the log. | 339 | ;; If SHORTLOG is true insert a short version of the log. |
| 340 | ;; If LIMIT is true insert only insert LIMIT log entries. If the | 340 | ;; If LIMIT is true insert only insert LIMIT log entries. If the |
| 341 | ;; backend does not support limiting the number of entries to show | 341 | ;; backend does not support limiting the number of entries to show |
| 342 | ;; it should return `limit-unsupported'. | 342 | ;; it should return `limit-unsupported'. |
| 343 | ;; If START-REVISION is given, then show the log starting from the | ||
| 344 | ;; revision. At this point START-REVISION is only required to work | ||
| 345 | ;; in conjunction with LIMIT = 1. | ||
| 343 | ;; | 346 | ;; |
| 344 | ;; - log-view-mode () | 347 | ;; - log-view-mode () |
| 345 | ;; | 348 | ;; |
| @@ -1863,7 +1866,7 @@ Not all VC backends support short logs!") | |||
| 1863 | (defvar log-view-vc-fileset) | 1866 | (defvar log-view-vc-fileset) |
| 1864 | 1867 | ||
| 1865 | (defun vc-print-log-internal (backend files working-revision | 1868 | (defun vc-print-log-internal (backend files working-revision |
| 1866 | &optional limit) | 1869 | &optional is-start-revision limit) |
| 1867 | ;; Don't switch to the output buffer before running the command, | 1870 | ;; Don't switch to the output buffer before running the command, |
| 1868 | ;; so that any buffer-local settings in the vc-controlled | 1871 | ;; so that any buffer-local settings in the vc-controlled |
| 1869 | ;; buffer can be accessed by the command. | 1872 | ;; buffer can be accessed by the command. |
| @@ -1878,8 +1881,9 @@ Not all VC backends support short logs!") | |||
| 1878 | (memq 'directory vc-log-short-style) | 1881 | (memq 'directory vc-log-short-style) |
| 1879 | (memq 'file vc-log-short-style))))) | 1882 | (memq 'file vc-log-short-style))))) |
| 1880 | 1883 | ||
| 1881 | (setq pl-return (vc-call-backend backend 'print-log files "*vc-change-log*" | 1884 | (setq pl-return (vc-call-backend |
| 1882 | vc-short-log limit)) | 1885 | backend 'print-log files "*vc-change-log*" |
| 1886 | vc-short-log (when is-start-revision working-revision) limit)) | ||
| 1883 | (pop-to-buffer "*vc-change-log*") | 1887 | (pop-to-buffer "*vc-change-log*") |
| 1884 | (let ((inhibit-read-only t)) | 1888 | (let ((inhibit-read-only t)) |
| 1885 | ;; log-view-mode used to be called with inhibit-read-only bound | 1889 | ;; log-view-mode used to be called with inhibit-read-only bound |
| @@ -1890,19 +1894,20 @@ Not all VC backends support short logs!") | |||
| 1890 | 1894 | ||
| 1891 | (vc-exec-after | 1895 | (vc-exec-after |
| 1892 | `(let ((inhibit-read-only t)) | 1896 | `(let ((inhibit-read-only t)) |
| 1893 | (when (and ,limit (not ,(eq 'limit-unsupported pl-return))) | 1897 | (when (and ,limit (not ,(eq 'limit-unsupported pl-return)) |
| 1898 | (not ,is-start-revision)) | ||
| 1894 | (goto-char (point-max)) | 1899 | (goto-char (point-max)) |
| 1895 | (widget-create 'push-button | 1900 | (widget-create 'push-button |
| 1896 | :notify (lambda (&rest ignore) | 1901 | :notify (lambda (&rest ignore) |
| 1897 | (vc-print-log-internal | 1902 | (vc-print-log-internal |
| 1898 | ',backend ',files ',working-revision (* 2 ,limit))) | 1903 | ',backend ',files ',working-revision nil (* 2 ,limit))) |
| 1899 | :help-echo "Show the log again, and double the number of log entries shown" | 1904 | :help-echo "Show the log again, and double the number of log entries shown" |
| 1900 | "Show 2X entries") | 1905 | "Show 2X entries") |
| 1901 | (widget-insert " ") | 1906 | (widget-insert " ") |
| 1902 | (widget-create 'push-button | 1907 | (widget-create 'push-button |
| 1903 | :notify (lambda (&rest ignore) | 1908 | :notify (lambda (&rest ignore) |
| 1904 | (vc-print-log-internal | 1909 | (vc-print-log-internal |
| 1905 | ',backend ',files ',working-revision nil)) | 1910 | ',backend ',files ',working-revision nil nil)) |
| 1906 | :help-echo "Show the log again, showing all entries" | 1911 | :help-echo "Show the log again, showing all entries" |
| 1907 | "Show unlimited entries") | 1912 | "Show unlimited entries") |
| 1908 | (widget-setup)) | 1913 | (widget-setup)) |
| @@ -1936,7 +1941,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision." | |||
| 1936 | (backend (car vc-fileset)) | 1941 | (backend (car vc-fileset)) |
| 1937 | (files (cadr vc-fileset)) | 1942 | (files (cadr vc-fileset)) |
| 1938 | (working-revision (or working-revision (vc-working-revision (car files))))) | 1943 | (working-revision (or working-revision (vc-working-revision (car files))))) |
| 1939 | (vc-print-log-internal backend files working-revision limit))) | 1944 | (vc-print-log-internal backend files working-revision nil limit))) |
| 1940 | 1945 | ||
| 1941 | ;;;###autoload | 1946 | ;;;###autoload |
| 1942 | (defun vc-print-root-log (&optional limit) | 1947 | (defun vc-print-root-log (&optional limit) |
| @@ -1962,7 +1967,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision." | |||
| 1962 | (error "Buffer is not version controlled")) | 1967 | (error "Buffer is not version controlled")) |
| 1963 | (setq rootdir (vc-call-backend backend 'root default-directory)) | 1968 | (setq rootdir (vc-call-backend backend 'root default-directory)) |
| 1964 | (setq working-revision (vc-working-revision rootdir)) | 1969 | (setq working-revision (vc-working-revision rootdir)) |
| 1965 | (vc-print-log-internal backend (list rootdir) working-revision limit))) | 1970 | (vc-print-log-internal backend (list rootdir) working-revision nil limit))) |
| 1966 | 1971 | ||
| 1967 | ;;;###autoload | 1972 | ;;;###autoload |
| 1968 | (defun vc-revert () | 1973 | (defun vc-revert () |