Patchwork [1,of,3] graphlog: optionally strip quotes from graphnode template (BC)

login
register
mail settings
Submitter Yuya Nishihara
Date April 15, 2017, 10:51 a.m.
Message ID <911c62c727e9c0d62815.1492253491@mimosa>
Download mbox | patch
Permalink /patch/20218/
State Accepted
Headers show

Comments

Yuya Nishihara - April 15, 2017, 10:51 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1488018496 -32400
#      Sat Feb 25 19:28:16 2017 +0900
# Node ID 911c62c727e9c0d628158a1655c1b69f725d20df
# Parent  83527d9f1f1381ffd7325b7c4297ffbdfed78236
graphlog: optionally strip quotes from graphnode template (BC)

For consistency with the other template options.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2154,6 +2154,7 @@  def _graphnodeformatter(ui, displayer):
     if not spec:
         return templatekw.showgraphnode  # fast path for "{graphnode}"
 
+    spec = templater.unquotestring(spec)
     templ = formatter.gettemplater(ui, 'graphnode', spec)
     cache = {}
     if isinstance(displayer, changeset_templater):
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -2398,7 +2398,7 @@  working-directory revision
 
 node template with changeset_printer:
 
-  $ hg log -Gqr 5:7 --config ui.graphnodetemplate='{rev}'
+  $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"'
   7  7:02dbb8e276b8
   |
   6    6:fc281d8ff18d