diff options
| author | Thien-Thi Nguyen | 2007-11-24 13:46:30 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2007-11-24 13:46:30 +0000 |
| commit | b16bd82da9f63eaba8129de859be24dac9957283 (patch) | |
| tree | 6ec7875d7e37dcce18a317385c9a5e187e664423 | |
| parent | bb78f3526155f0fd8551c1a6461e491133654777 (diff) | |
| download | emacs-b16bd82da9f63eaba8129de859be24dac9957283.tar.gz emacs-b16bd82da9f63eaba8129de859be24dac9957283.zip | |
(vc-git-show-log-entry): New func.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc-git.el | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49a08c36ddf..79836fb9adc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-11-24 Thien-Thi Nguyen <ttn@gnuvola.org> | ||
| 2 | |||
| 3 | * vc-git.el (vc-git-show-log-entry): New func. | ||
| 4 | |||
| 1 | 2007-11-24 Glenn Morris <rgm@gnu.org> | 5 | 2007-11-24 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * emacs-lisp/byte-run.el (declare-function): Doc fix. | 7 | * emacs-lisp/byte-run.el (declare-function): Doc fix. |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 07714b26c32..f891bac8bd1 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -81,7 +81,7 @@ | |||
| 81 | ;; HISTORY FUNCTIONS | 81 | ;; HISTORY FUNCTIONS |
| 82 | ;; * print-log (files &optional buffer) OK | 82 | ;; * print-log (files &optional buffer) OK |
| 83 | ;; - log-view-mode () OK | 83 | ;; - log-view-mode () OK |
| 84 | ;; - show-log-entry (revision) NOT NEEDED, DEFAULT IS GOOD | 84 | ;; - show-log-entry (revision) OK |
| 85 | ;; - wash-log (file) COULD BE SUPPORTED | 85 | ;; - wash-log (file) COULD BE SUPPORTED |
| 86 | ;; - logentry-check () NOT NEEDED | 86 | ;; - logentry-check () NOT NEEDED |
| 87 | ;; - comment-history (file) ?? | 87 | ;; - comment-history (file) ?? |
| @@ -312,6 +312,19 @@ | |||
| 312 | ("^Date: \\(.+\\)" (1 'change-log-date)) | 312 | ("^Date: \\(.+\\)" (1 'change-log-date)) |
| 313 | ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) | 313 | ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) |
| 314 | 314 | ||
| 315 | (defun vc-git-show-log-entry (revision) | ||
| 316 | "Move to the log entry for REVISION. | ||
| 317 | REVISION may have the form BRANCH, BRANCH~N, | ||
| 318 | or BRANCH^ (where \"^\" can be repeated)." | ||
| 319 | (goto-char (point-min)) | ||
| 320 | (search-forward "\ncommit" nil t | ||
| 321 | (cond ((string-match "~\\([0-9]\\)$" revision) | ||
| 322 | (1+ (string-to-number (match-string 1 revision)))) | ||
| 323 | ((string-match "\\^+$" revision) | ||
| 324 | (1+ (length (match-string 0 revision)))) | ||
| 325 | (t nil))) | ||
| 326 | (beginning-of-line)) | ||
| 327 | |||
| 315 | (defun vc-git-diff (files &optional rev1 rev2 buffer) | 328 | (defun vc-git-diff (files &optional rev1 rev2 buffer) |
| 316 | (let ((buf (or buffer "*vc-diff*"))) | 329 | (let ((buf (or buffer "*vc-diff*"))) |
| 317 | (if (and rev1 rev2) | 330 | (if (and rev1 rev2) |