]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc-hg.el (vc-hg-log-graph): New var.
authorSantiago Payà i Miralta <santiagopim@gmail.com>
Fri, 6 Jun 2014 16:11:53 +0000 (12:11 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Jun 2014 16:11:53 +0000 (12:11 -0400)
(vc-hg-print-log): Use it.
(vc-hg-root-log-format): Include branch name and bookmarks; ignore
graph output.

Fixes: debbugs:17515
lisp/ChangeLog
lisp/vc/vc-hg.el

index 5f7390292f7fa24cf0a248f9d8cc55486b97251f..3b9b1e9f5b9ec49ed851be98f794b0f1c6cf4404 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-06  Santiago Payà i Miralta  <santiagopim@gmail.com>
+
+       * vc/vc-hg.el (vc-hg-log-graph): New var.
+       (vc-hg-print-log): Use it.
+       (vc-hg-root-log-format): Include branch name and bookmarks; ignore
+       graph output (bug#17515).
+
 2014-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * mouse.el (mouse-posn-property): Ignore buffer position info when the
        * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled
        into autoloading just because of a silly indirection.
 
-2014-05-12  Santiago Payà i Miralta  <santiagopim@gmail.com>  (tiny change)
+2014-05-12  Santiago Payà i Miralta  <santiagopim@gmail.com>
 
        * vc/vc-hg.el (vc-hg-unregister): New function.  (Bug#17454)
 
index 05b53a3eeb6add2fb2f083ed067f30832a66d0d1..28cf48f54d600383f99f5a3304d1623fca3365b3 100644 (file)
@@ -146,12 +146,19 @@ 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\\}\\)"
+  `(,(concat "{rev}:{ifeq(branch, 'default','', '{branch}')}"
+             ":{bookmarks}:{tags}:{author|person}"
+             " {date|shortdate} {desc|firstline}\\n")
+    ,(concat "^\\(?:[+@o x|-]*\\)"      ;Graph data.
+             "\\([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)))
+     (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,
@@ -160,7 +167,7 @@ output, and KEYWORDS is a list of `font-lock-keywords' for
 highlighting the Log View buffer."
   :type '(list string string (repeat sexp))
   :group 'vc-hg
-  :version "24.1")
+  :version "24.5")
 
 \f
 ;;; Properties of the backend
@@ -247,6 +254,9 @@ highlighting the Log View buffer."
 
 (autoload 'vc-setup-buffer "vc-dispatcher")
 
+(defvar vc-hg-log-graph nil
+  "If non-nil, use `--graph' in the short log output.")
+
 (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'.
@@ -264,7 +274,9 @@ 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 (list "--template" (car vc-hg-root-log-format)))
+             (when shortlog `(,@(if vc-hg-log-graph '("--graph"))
+                               "--template"
+                               ,(car vc-hg-root-log-format)))
              vc-hg-log-switches)))))
 
 (defvar log-view-message-re)