emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 99ded6b: Show full commit messages in 'hg log' when


From: Dmitry Gutov
Subject: [Emacs-diffs] master 99ded6b: Show full commit messages in 'hg log' when appropriate
Date: Tue, 27 Oct 2015 13:13:11 +0000

branch: master
commit 99ded6be7afe843d7abc0e255fe36b684435cfd7
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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)
---
 lisp/vc/vc-hg.el |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index c4d6092..8d9493e 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -259,6 +259,14 @@ highlighting the Log View buffer."
 (defvar vc-hg-log-graph nil
   "If non-nil, use `--graph' in the short log output.")
 
+(defvar vc-hg-log-format (concat "changeset:   {rev}:{node|short}\n"
+                                 "{tags % 'tag:         {tag}\n'}"
+                                 "{if(parents, 'parents:     {parents}\n')}"
+                                 "user:        {author}\n"
+                                 "Date:        {date|date}\n"
+                                 "summary:     {desc}\n\n")
+  "Mercurial log template for `vc-hg-print-log' long format.")
+
 (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit)
   "Print commit log associated with FILES into specified BUFFER.
 If 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."
             (nconc
              (when start-revision (list (format "-r%s:0" start-revision)))
              (when limit (list "-l" (format "%s" limit)))
-             (when shortlog `(,@(if vc-hg-log-graph '("--graph"))
-                               "--template"
-                               ,(car vc-hg-root-log-format)))
+             (if shortlog
+                  `(,@(if vc-hg-log-graph '("--graph"))
+                    "--template"
+                    ,(car vc-hg-root-log-format))
+                `("--template" ,vc-hg-log-format))
              vc-hg-log-switches)))))
 
 (defvar log-view-message-re)
@@ -345,7 +355,7 @@ If LIMIT is non-nil, show no more than this many entries."
 
 (defun vc-hg-expanded-log-entry (revision)
   (with-temp-buffer
-    (vc-hg-command t nil nil "log" "-r" revision)
+    (vc-hg-command t nil nil "log" "-r" revision "--template" vc-hg-log-format)
     (goto-char (point-min))
     (unless (eobp)
       ;; Indent the expanded log entry.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]