aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-10-27 14:55:06 +0200
committerDmitry Gutov2015-10-27 14:55:06 +0200
commit99ded6be7afe843d7abc0e255fe36b684435cfd7 (patch)
tree1db0890ed38df8fd711d7a0ceb8766a511d7f72d
parentf642a81acdfc402805c26d00d05d977c2fb7da8c (diff)
downloademacs-99ded6be7afe843d7abc0e255fe36b684435cfd7.tar.gz
emacs-99ded6be7afe843d7abc0e255fe36b684435cfd7.zip
Show full commit messages in 'hg log' when appropriate
* lisp/vc/vc-hg.el (vc-hg-log-format): New variable. (vc-hg-print-log, vc-hg-expanded-log-entry): Use it. (http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg02191.html)
-rw-r--r--lisp/vc/vc-hg.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index c4d6092d100..8d9493ec210 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -259,6 +259,14 @@ highlighting the Log View buffer."
259(defvar vc-hg-log-graph nil 259(defvar vc-hg-log-graph nil
260 "If non-nil, use `--graph' in the short log output.") 260 "If non-nil, use `--graph' in the short log output.")
261 261
262(defvar vc-hg-log-format (concat "changeset: {rev}:{node|short}\n"
263 "{tags % 'tag: {tag}\n'}"
264 "{if(parents, 'parents: {parents}\n')}"
265 "user: {author}\n"
266 "Date: {date|date}\n"
267 "summary: {desc}\n\n")
268 "Mercurial log template for `vc-hg-print-log' long format.")
269
262(defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) 270(defun vc-hg-print-log (files buffer &optional shortlog start-revision limit)
263 "Print commit log associated with FILES into specified BUFFER. 271 "Print commit log associated with FILES into specified BUFFER.
264If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'. 272If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'.
@@ -276,9 +284,11 @@ If LIMIT is non-nil, show no more than this many entries."
276 (nconc 284 (nconc
277 (when start-revision (list (format "-r%s:0" start-revision))) 285 (when start-revision (list (format "-r%s:0" start-revision)))
278 (when limit (list "-l" (format "%s" limit))) 286 (when limit (list "-l" (format "%s" limit)))
279 (when shortlog `(,@(if vc-hg-log-graph '("--graph")) 287 (if shortlog
280 "--template" 288 `(,@(if vc-hg-log-graph '("--graph"))
281 ,(car vc-hg-root-log-format))) 289 "--template"
290 ,(car vc-hg-root-log-format))
291 `("--template" ,vc-hg-log-format))
282 vc-hg-log-switches))))) 292 vc-hg-log-switches)))))
283 293
284(defvar log-view-message-re) 294(defvar log-view-message-re)
@@ -345,7 +355,7 @@ If LIMIT is non-nil, show no more than this many entries."
345 355
346(defun vc-hg-expanded-log-entry (revision) 356(defun vc-hg-expanded-log-entry (revision)
347 (with-temp-buffer 357 (with-temp-buffer
348 (vc-hg-command t nil nil "log" "-r" revision) 358 (vc-hg-command t nil nil "log" "-r" revision "--template" vc-hg-log-format)
349 (goto-char (point-min)) 359 (goto-char (point-min))
350 (unless (eobp) 360 (unless (eobp)
351 ;; Indent the expanded log entry. 361 ;; Indent the expanded log entry.