Mercurial > emacs
comparison lisp/vc-git.el @ 86397:38193bd1ab69
(vc-git-show-log-entry): New func.
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Sat, 24 Nov 2007 13:44:51 +0000 |
parents | 43a9834cf1a6 |
children | fdd891feb624 |
comparison
equal
deleted
inserted
replaced
86396:88a00b9cc363 | 86397:38193bd1ab69 |
---|---|
79 ;; - merge-news (file) see `merge' | 79 ;; - merge-news (file) see `merge' |
80 ;; - steal-lock (file &optional revision) NOT NEEDED | 80 ;; - steal-lock (file &optional revision) NOT NEEDED |
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) ?? |
88 ;; - update-changelog (files) COULD BE SUPPORTED | 88 ;; - update-changelog (files) COULD BE SUPPORTED |
89 ;; * diff (file &optional rev1 rev2 buffer) OK | 89 ;; * diff (file &optional rev1 rev2 buffer) OK |
309 ("^Merge: \\([0-9a-z]+\\) \\([0-9a-z]+\\)" | 309 ("^Merge: \\([0-9a-z]+\\) \\([0-9a-z]+\\)" |
310 (1 'change-log-acknowledgement) | 310 (1 'change-log-acknowledgement) |
311 (2 'change-log-acknowledgement)) | 311 (2 'change-log-acknowledgement)) |
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 | |
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)) | |
314 | 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) |
318 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--") | 331 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--") |