changeset 22588:cd1b43226b34

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 30 Sep 2014 18:22:58 -0500
parents c3c3dd31fe1c (current diff) 4fe5fa49eac8 (diff)
children 9ab18a912c44
files mercurial/cmdutil.py tests/test-command-template.t
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Sep 30 16:40:10 2014 -0500
+++ b/mercurial/cmdutil.py	Tue Sep 30 18:22:58 2014 -0500
@@ -1215,7 +1215,7 @@
     """
 
     # ui settings
-    if not tmpl and not style:
+    if not tmpl and not style: # template are stronger than style
         tmpl = ui.config('ui', 'logtemplate')
         if tmpl:
             try:
@@ -1226,7 +1226,7 @@
         else:
             style = util.expandpath(ui.config('ui', 'style', ''))
 
-    if style:
+    if not tmpl and style:
         mapfile = style
         if not os.path.split(mapfile)[0]:
             mapname = (templater.templatepath('map-cmdline.' + mapfile)
--- a/tests/test-command-template.t	Tue Sep 30 16:40:10 2014 -0500
+++ b/tests/test-command-template.t	Tue Sep 30 18:22:58 2014 -0500
@@ -86,6 +86,11 @@
   $ hg log -l1 -T./map-simple
   8
 
+Template should precede style option
+
+  $ hg log -l1 --style default -T '{rev}\n'
+  8
+
 Default style is like normal output:
 
   $ hg log > log.out