Mercurial > emacs
diff lisp/vc-bzr.el @ 105010:b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
argument. Add a new method: root.
* vc-hooks.el (vc-prefix-map, vc-menu-map): Add bindings for
vc-print-root-log and vc-print-root-diff.
* vc-bzr.el (vc-bzr-log-view-mode, vc-bzr-print-log):
* vc-git.el (vc-git-print-log, vc-git-log-view-mode):
* vc-hg.el (vc-hg-print-log, vc-hg-log-view-mode): Add support for
short logs.
* vc-cvs.el (vc-cvs-print-log):
* vc-mtn.el (vc-mtn-print-log):
* vc-rcs.el (vc-rcs-print-log):
* vc-sccs.el (vc-sccs-print-log):
* vc-svn.el (vc-svn-print-log): Add an optional argument shortlog
that is ignored for now.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Mon, 14 Sep 2009 04:38:49 +0000 |
parents | 7c3b132bf9bb |
children | 136cf2d23c90 |
line wrap: on
line diff
--- a/lisp/vc-bzr.el Mon Sep 14 01:22:42 2009 +0000 +++ b/lisp/vc-bzr.el Mon Sep 14 04:38:49 2009 +0000 @@ -453,6 +453,7 @@ (defvar log-view-font-lock-keywords) (defvar log-view-current-tag-function) (defvar log-view-per-file-logs) +(defvar vc-short-log) (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. @@ -460,19 +461,27 @@ (set (make-local-variable 'log-view-per-file-logs) nil) (set (make-local-variable 'log-view-file-re) "\\`a\\`") (set (make-local-variable 'log-view-message-re) - "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)") + (if vc-short-log + "^ +\\([0-9]+\\) \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?" + "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)")) (set (make-local-variable 'log-view-font-lock-keywords) ;; log-view-font-lock-keywords is careful to use the buffer-local ;; value of log-view-message-re only since Emacs-23. - (append `((,log-view-message-re . 'log-view-message-face)) - ;; log-view-font-lock-keywords - '(("^ *committer: \ + (if vc-short-log + (append `((,log-view-message-re + (1 'log-view-message-face) + (2 'change-log-name) + (3 'change-log-date) + (4 'change-log-list)))) + (append `((,log-view-message-re . 'log-view-message-face)) + ;; log-view-font-lock-keywords + '(("^ *committer: \ \\([^<(]+?\\)[ ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]" - (1 'change-log-name) - (2 'change-log-email)) - ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face)))))) + (1 'change-log-name) + (2 'change-log-email)) + ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face))))))) -(defun vc-bzr-print-log (files &optional buffer) ; get buffer arg in Emacs 22 +(defun vc-bzr-print-log (files &optional buffer shortlog) ; get buffer arg in Emacs 22 "Get bzr change log for FILES into specified BUFFER." ;; `vc-do-command' creates the buffer, but we need it before running ;; the command. @@ -484,6 +493,7 @@ ;; way of getting the above regexps working. (with-current-buffer buffer (apply 'vc-bzr-command "log" buffer 'async files + (if shortlog "--short") (if (stringp vc-bzr-log-switches) (list vc-bzr-log-switches) vc-bzr-log-switches))))