diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py index eaa6be79d6..2757fb9879 100644 --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1087,7 +1087,7 @@ def gettemplate(ui, tmpl, style): """ # 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: @@ -1098,7 +1098,7 @@ def gettemplate(ui, tmpl, style): 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) diff --git a/tests/test-command-template.t b/tests/test-command-template.t index 06f61e21d4..6b7450ff75 100644 --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -86,6 +86,11 @@ Test templates and style maps in files: $ 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