# HG changeset patch # User Robert Bachmann # Date 1262137279 -3600 # Node ID 48653dea23dd7d58acf0be61f05edd43ce28142e # Parent 1824162277228ec15d1db81747b20fd2e8611586 Bugfix and test for hg log XML output diff -r 182416227722 -r 48653dea23dd mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Dec 30 02:38:53 2009 +0100 +++ b/mercurial/cmdutil.py Wed Dec 30 02:41:19 2009 +0100 @@ -844,7 +844,7 @@ self.ui.write(templater.stringify(self.t(key, **props))) self.showpatch(ctx.node()) - if types['header']: + if types['footer']: if not self.footer: self.footer = templater.stringify(self.t(types['footer'], **props)) diff -r 182416227722 -r 48653dea23dd tests/test-command-template --- a/tests/test-command-template Wed Dec 30 02:38:53 2009 +0100 +++ b/tests/test-command-template Wed Dec 30 02:41:19 2009 +0100 @@ -62,6 +62,14 @@ hg log -v --style compact hg log --debug --style compact +# Test xml styles +echo '# xml style works (--style xml)' +hg log --style xml +echo '# xml style works (-v --style xml)' +hg log -v --style xml +echo '# xml style works (--debug --style xml)' +hg log --debug --style xml + echo '# error if style not readable' touch q chmod 0 q diff -r 182416227722 -r 48653dea23dd tests/test-command-template.out --- a/tests/test-command-template.out Wed Dec 30 02:38:53 2009 +0100 +++ b/tests/test-command-template.out Wed Dec 30 02:41:19 2009 +0100 @@ -97,6 +97,266 @@ line 1 line 2 +# xml style works (--style xml) + + + +tip +test +2020-01-01T10:01:00+00:00 +third + + + +User Name +1970-01-12T13:46:40+00:00 +second + + + + +person +1970-01-18T08:40:01+00:00 +merge + + + +person +1970-01-18T08:40:00+00:00 +new head + + +foo +person +1970-01-17T04:53:20+00:00 +new branch + + +person +1970-01-16T01:06:40+00:00 +no user, no domain + + +other +1970-01-14T21:20:00+00:00 +no person + + +A. N. Other +1970-01-13T17:33:20+00:00 +other 1 +other 2 + +other 3 + + +User Name +1970-01-12T13:46:40+00:00 +line 1 +line 2 + + +# xml style works (-v --style xml) + + + +tip +test +2020-01-01T10:01:00+00:00 +third + +fourth +third +second + + +fourth + + + + +User Name +1970-01-12T13:46:40+00:00 +second + +second + + + + + +person +1970-01-18T08:40:01+00:00 +merge + + + + + +person +1970-01-18T08:40:00+00:00 +new head + +d + + + +foo +person +1970-01-17T04:53:20+00:00 +new branch + + + + +person +1970-01-16T01:06:40+00:00 +no user, no domain + +c + + + +other +1970-01-14T21:20:00+00:00 +no person + +c + + + +A. N. Other +1970-01-13T17:33:20+00:00 +other 1 +other 2 + +other 3 + +b + + + +User Name +1970-01-12T13:46:40+00:00 +line 1 +line 2 + +a + + + +# xml style works (--debug --style xml) + + + +tip + + +test +2020-01-01T10:01:00+00:00 +third + +fourth +third +second + + +fourth + +default + + + + +User Name +1970-01-12T13:46:40+00:00 +second + +second + +default + + + + +person +1970-01-18T08:40:01+00:00 +merge + + +default + + + + +person +1970-01-18T08:40:00+00:00 +new head + +d + +default + + +foo + + +person +1970-01-17T04:53:20+00:00 +new branch + + +foo + + + + +person +1970-01-16T01:06:40+00:00 +no user, no domain + +c + +default + + + + +other +1970-01-14T21:20:00+00:00 +no person + +c + +default + + + + +A. N. Other +1970-01-13T17:33:20+00:00 +other 1 +other 2 + +other 3 + +b + +default + + + + +User Name +1970-01-12T13:46:40+00:00 +line 1 +line 2 + +a + +default + + # error if style not readable abort: Permission denied: ./q # error if no style