summaryrefslogtreecommitdiff
path: root/lisp/vc-bzr.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-09-14 04:38:49 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-09-14 04:38:49 +0000
commit32ba3abcc148f356994a77b72052cca9da85ee4b (patch)
tree80b02f751f602b61e02e0ad58bb32a4e149639b6 /lisp/vc-bzr.el
parent31cd2dd4e14916714a5178b57dfda171a219cc93 (diff)
downloademacs-32ba3abcc148f356994a77b72052cca9da85ee4b.tar.gz
emacs-32ba3abcc148f356994a77b72052cca9da85ee4b.tar.bz2
emacs-32ba3abcc148f356994a77b72052cca9da85ee4b.zip
* 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.
Diffstat (limited to 'lisp/vc-bzr.el')
-rw-r--r--lisp/vc-bzr.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index b7e0b65e48a..da9c97f2c17 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -453,6 +453,7 @@ REV non-nil gets an error."
(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 @@ REV non-nil gets an error."
(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 @@ REV non-nil gets an error."
;; 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))))