summaryrefslogtreecommitdiff
path: root/lisp/vc-hg.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-hg.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-hg.el')
-rw-r--r--lisp/vc-hg.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index a8a8895de01..4a81ffb232f 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -68,7 +68,7 @@
;; - merge-news (file) NEEDED
;; - steal-lock (file &optional revision) NOT NEEDED
;; HISTORY FUNCTIONS
-;; * print-log (files &optional buffer) OK
+;; * print-log (files &optional buffer shortlog)OK
;; - log-view-mode () OK
;; - show-log-entry (revision) NOT NEEDED, DEFAULT IS GOOD
;; - comment-history (file) NOT NEEDED
@@ -217,7 +217,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(repeat :tag "Argument List" :value ("") string))
:group 'vc-hg)
-(defun vc-hg-print-log (files &optional buffer)
+(defun vc-hg-print-log (files &optional buffer shortlog)
"Get change log associated with FILES."
;; `log-view-mode' needs to have the file names in order to function
;; correctly. "hg log" does not print it, so we insert it here by
@@ -231,20 +231,31 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(let ((inhibit-read-only t))
(with-current-buffer
buffer
- (apply 'vc-hg-command buffer 0 files "log" vc-hg-log-switches))))
+ (apply 'vc-hg-command buffer 0 files "log"
+ (if shortlog '("--style" "compact"))
+ vc-hg-log-switches))))
(defvar log-view-message-re)
(defvar log-view-file-re)
(defvar log-view-font-lock-keywords)
(defvar log-view-per-file-logs)
+(defvar vc-short-log)
(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
(require 'add-log) ;; we need the add-log faces
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
- "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")
+ (if vc-short-log
+ "^\\([0-9]+\\)\\(?:\\[.*\\]\\)? +\\([0-9a-z]\\{12\\}\\) +\\(\\(?:[0-9]+\\)-\\(?:[0-9]+\\)-\\(?:[0-9]+\\) \\(?:[0-9]+\\):\\(?:[0-9]+\\) \\(?:[-+0-9]+\\)\\) +\\(.*\\)$"
+ "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)"))
(set (make-local-variable 'log-view-font-lock-keywords)
+ (if vc-short-log
+ (append `((,log-view-message-re
+ (1 'log-view-message-face)
+ (2 'log-view-message-face)
+ (3 'change-log-date)
+ (4 'change-log-name))))
(append
log-view-font-lock-keywords
'(
@@ -260,7 +271,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
("^user:[ \t]+\\([A-Za-z0-9_.+-]+\\(?:@[A-Za-z0-9_.-]+\\)?\\)"
(1 'change-log-email))
("^date: \\(.+\\)" (1 'change-log-date))
- ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))
+ ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))))
(defun vc-hg-diff (files &optional oldvers newvers buffer)
"Get a difference report using hg between two revisions of FILES."