# HG changeset patch # User Thomas Arendsen Hein # Date 1159557855 -7200 # Node ID a6d0cd63068c3883ed9e0b63b5e59790713645be # Parent f2ed26736dfa9f4fdbe1492c223eda20efd14599 Make "hg log --style=changelog > changelog" work (issue338) Style files in templates/ now take precedence over current directory. This can be overridden with --style=./changelog if really neeeded. Added test for issue338. diff -r f2ed26736dfa -r a6d0cd63068c mercurial/commands.py --- a/mercurial/commands.py Fri Sep 29 19:43:07 2006 +0200 +++ b/mercurial/commands.py Fri Sep 29 21:24:15 2006 +0200 @@ -399,9 +399,9 @@ if tmpl or mapfile: if mapfile: - if not os.path.isfile(mapfile): - mapname = templater.templatepath('map-cmdline.' + mapfile) - if not mapname: mapname = templater.templatepath(mapfile) + if not os.path.split(mapfile)[0]: + mapname = (templater.templatepath('map-cmdline.' + mapfile) + or templater.templatepath(mapfile)) if mapname: mapfile = mapname try: t = templater.changeset_templater(ui, repo, mapfile) diff -r f2ed26736dfa -r a6d0cd63068c tests/test-command-template --- a/tests/test-command-template Fri Sep 29 19:43:07 2006 +0200 +++ b/tests/test-command-template Fri Sep 29 21:24:15 2006 +0200 @@ -65,6 +65,10 @@ echo 'style = t' >> .hg/hgrc hg log +echo '# issue338' +hg log --style=changelog > changelog +cat changelog + echo "# keys work" for key in author branches date desc file_adds file_dels files \ manifest node parents rev tags; do diff -r f2ed26736dfa -r a6d0cd63068c tests/test-command-template.out --- a/tests/test-command-template.out Fri Sep 29 19:43:07 2006 +0200 +++ b/tests/test-command-template.out Fri Sep 29 21:24:15 2006 +0200 @@ -76,6 +76,33 @@ 2 1 0 +# issue338 +1970-01-16 person + + * c: + no user, no domain + [10e46f2dcbf4] [tip] + +1970-01-14 other + + * c: + no person + [97054abb4ab8] + +1970-01-13 A. N. Other + + * b: + other 1 other 2 + + other 3 + [b608e9d1a3f0] + +1970-01-12 User Name + + * a: + line 1 line 2 + [1e4e1b8f71e0] + # keys work author: person author: other@place