unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17515: * lisp/vc/vc-hg.el (vc-hg-root-log-format): New format supports graph, branches and bookmarks.
@ 2014-05-16 22:09 Santiago Payà i Miralta
  2014-05-18 23:23 ` bug#17515: Correction: using log-switch causes normal non shortlog use fail format Santiago Payà i Miralta
  0 siblings, 1 reply; 5+ messages in thread
From: Santiago Payà i Miralta @ 2014-05-16 22:09 UTC (permalink / raw)
  To: 17515

[-- Attachment #1: Type: text/plain, Size: 3055 bytes --]

Hi emacs,

I wish to improve the vc-change-log buffer in vc-hg with the graph view. My
proposal is a change in default configuration. The vc-hg-root-log-format is
compatible with or without the graph view. Also added branches and
bookmarks.

2014-05-17 Santiago Payà i Miralta <santiagopim@gmail.com>

        * lisp/vc/vc-hg.el (vc-hg-root-log-format): New format
 supports graph, branches and bookmarks.

From a917e85f083907030daea6d1cf70ba524f5bbab9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Santiago=20Pay=C3=A0=20i=20Miralta?= <santiagopim@gmail.com>
Date: Fri, 16 May 2014 23:58:57 +0200
Subject: [PATCH] * lisp/vc/vc-hg.el (vc-hg-root-log-format): New format
 supports graph, branches and bookmarks.

Modern Mercurial log command supports --graph, also the graphlog extension
is widely used in ancient Mercurial. So with adding this default
configuration vc-hg users may see the graph DAG in the vc-change-log
buffer. Users have the choice to define vc-hg-log-switches as nil again,
the vc-hg-root-log-format is compatible with no graph switch.

Also added branches and bookmarks to the log format, with some different
but existing faces from add-log.
---
 lisp/vc/vc-hg.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 05b53a3..649c736 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -146,12 +146,14 @@ If nil, use the value of `vc-diff-switches'.  If t,
use no switches."
   :group 'vc-hg)

 (defcustom vc-hg-root-log-format
-  '("{rev}:{tags}: {author|person} {date|shortdate} {desc|firstline}\\n"
-    "^\\([0-9]+\\):\\([^:]*\\): \\(.*?\\)[
\t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)"
-    ((1 'log-view-message-face)
-     (2 'change-log-list)
-     (3 'change-log-name)
-     (4 'change-log-date)))
+  '("{rev}:{ifeq(branch, 'default','', '{branch}')}:{bookmarks}:{tags}:
{author|person} {date|shortdate} {desc|firstline}\\n"
+    "^\\(?:[+@o x|-]*\\)\\([0-9]+\\):\\([^:]*\\):\\([^:]*\\):\\([^:]*\\):
\\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)"
+((1 'log-view-message-face)
+     (2 'change-log-file)
+     (3 'change-log-list)
+     (4 'change-log-conditionals)
+     (5 'change-log-name)
+     (6 'change-log-date)))
   "Mercurial log template for `vc-hg-print-log' short format.
 This should be a list (TEMPLATE REGEXP KEYWORDS), where TEMPLATE
 is the \"--template\" argument string to pass to Mercurial,
@@ -238,8 +240,9 @@ highlighting the Log View buffer."

 ;;; History functions

-(defcustom vc-hg-log-switches nil
-  "String or list of strings specifying switches for hg log under VC."
+(defcustom vc-hg-log-switches (list "--graph")
+  "String or list of strings specifying switches for hg log under VC.
+Using --graph needs Mercurial 3.0+ or the graphlog extension."
   :type '(choice (const :tag "None" nil)
                  (string :tag "Argument String")
                  (repeat :tag "Argument List" :value ("") string))
-- 
2.0.0.rc0

[-- Attachment #2: Type: text/html, Size: 9680 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-18  5:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 22:09 bug#17515: * lisp/vc/vc-hg.el (vc-hg-root-log-format): New format supports graph, branches and bookmarks Santiago Payà i Miralta
2014-05-18 23:23 ` bug#17515: Correction: using log-switch causes normal non shortlog use fail format Santiago Payà i Miralta
2014-06-06 16:12   ` Stefan Monnier
2014-06-07 20:24     ` Santiago
2015-12-18  5:08       ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).