##// END OF EJS Templates
Bugfix and test for hg log XML output
Bugfix and test for hg log XML output

File last commit:

r10160:48653dea default
r10160:48653dea default
Show More
test-command-template
185 lines | 4.4 KiB | text/plain | TextLexer
/ tests / test-command-template
Vadim Gelfer
add tests for command line template....
r1915 #!/bin/sh
hg init a
cd a
echo a > a
hg add a
echo line 1 > b
echo line 2 >> b
Thomas Arendsen Hein
Use timestamps without leading 0 in test-command-template for portable tests.
r1939 hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>'
Vadim Gelfer
add tests for command line template....
r1915 hg add b
echo other 1 > c
echo other 2 >> c
echo >> c
echo other 3 >> c
Thomas Arendsen Hein
Use timestamps without leading 0 in test-command-template for portable tests.
r1939 hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>'
Vadim Gelfer
add tests for command line template....
r1915 hg add c
Thomas Arendsen Hein
Use timestamps without leading 0 in test-command-template for portable tests.
r1939 hg commit -m 'no person' -d '1200000 0' -u 'other@place'
Vadim Gelfer
add tests for command line template....
r1915 echo c >> c
Thomas Arendsen Hein
Use timestamps without leading 0 in test-command-template for portable tests.
r1939 hg commit -m 'no user, no domain' -d '1300000 0' -u 'person'
Thomas Arendsen Hein
Extended templating test for new branches and extra changeset info.
r3463 echo foo > .hg/branch
hg commit -m 'new branch' -d '1400000 0' -u 'person'
TK Soh
test-command-template: improve test coverage
r4353 hg co -q 3
echo other 4 >> d
hg add d
hg commit -m 'new head' -d '1500000 0' -u 'person'
Dirkjan Ochtman
merge: only in-branch merges can be implicit
r6723 hg merge -q foo
TK Soh
test-command-template: improve test coverage
r4353 hg commit -m 'merge' -d '1500001 0' -u 'person'
Thomas Arendsen Hein
hg log: Move filtering implicit parents to own method and use it in templater....
r4825 # second branch starting at nullrev
hg update null
echo second > second
hg add second
hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>'
Dirkjan Ochtman
templater: fix age filter to state the obvious on future timestamps
r7682 echo third > third
hg add third
Patrick Mezard
test-command-template: test 'file_copies' keyword
r10059 hg mv second fourth
Dirkjan Ochtman
templater: fix age filter to state the obvious on future timestamps
r7682 hg commit -m third -d "2020-01-01 10:01"
Vadim Gelfer
add tests for command line template....
r1915
# make sure user/global hgrc does not affect tests
echo '[ui]' > .hg/hgrc
echo 'logtemplate =' >> .hg/hgrc
echo 'style =' >> .hg/hgrc
echo '# default style is like normal output'
Thomas Arendsen Hein
Adjust default cmdline style to really match verbose/debug log.
r3459 echo '# normal'
Vadim Gelfer
add tests for command line template....
r1915 hg log > log.out
hg log --style default > style.out
Mads Kiilerich
test-command-template: Don't diff files with same content...
r9382 cmp log.out style.out || diff -u log.out style.out
Thomas Arendsen Hein
Adjust default cmdline style to really match verbose/debug log.
r3459 echo '# verbose'
Vadim Gelfer
add tests for command line template....
r1915 hg log -v > log.out
hg log -v --style default > style.out
Mads Kiilerich
test-command-template: Don't diff files with same content...
r9382 cmp log.out style.out || diff -u log.out style.out
Thomas Arendsen Hein
Adjust default cmdline style to really match verbose/debug log.
r3459 echo '# debug'
Vadim Gelfer
add tests for command line template....
r1915 hg log --debug > log.out
hg log --debug --style default > style.out
Mads Kiilerich
test-command-template: Don't diff files with same content...
r9382 cmp log.out style.out || diff -u log.out style.out
Vadim Gelfer
add tests for command line template....
r1915
Alexis S. L. Carvalho
fix 'hg <not-log> -v --template foo' with revisions without copies
r4351 echo '# revision with no copies (used to print a traceback)'
hg tip -v --template '\n'
Vadim Gelfer
add tests for command line template....
r1915 echo '# compact style works'
hg log --style compact
hg log -v --style compact
hg log --debug --style compact
Robert Bachmann
Bugfix and test for hg log XML output
r10160 # 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
Vadim Gelfer
add tests for command line template....
r1915 echo '# error if style not readable'
touch q
chmod 0 q
hg log --style ./q
echo '# error if no style'
hg log --style notexist
echo '# error if style missing key'
echo 'q = q' > t
hg log --style ./t
echo '# error if include fails'
echo 'changeset = q' >> t
hg log --style ./t
echo '# include works'
Thomas Arendsen Hein
Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
r3988 rm q
Vadim Gelfer
add tests for command line template....
r1915 echo '{rev}' > q
hg log --style ./t
echo '# ui.style works'
echo '[ui]' > .hg/hgrc
echo 'style = t' >> .hg/hgrc
hg log
Thomas Arendsen Hein
Make "hg log --style=changelog > changelog" work (issue338)...
r3193 echo '# issue338'
hg log --style=changelog > changelog
cat changelog
Vadim Gelfer
add tests for command line template....
r1915 echo "# keys work"
Patrick Mezard
cmdutil: make "files" list all files, add "file_mods" for modified files
r5550 for key in author branches date desc file_adds file_dels file_mods \
Patrick Mezard
Make {file_copies} usable as a --template key...
r10061 file_copies file_copies_switch files \
Patrick Mezard
templatekw: change {file_copies} behaviour, add {file_copies_switch}...
r10060 manifest node parents rev tags diffstat extras; do
Vadim Gelfer
add tests for command line template....
r1915 for mode in '' --verbose --debug; do
hg log $mode --template "$key$mode: {$key}\n"
done
done
echo '# filters work'
hg log --template '{author|domain}\n'
hg log --template '{author|person}\n'
hg log --template '{author|user}\n'
Vadim Gelfer
fix test failures that depend on when tests run.
r1916 hg log --template '{date|age}\n' > /dev/null || exit 1
Dirkjan Ochtman
templater: fix age filter to state the obvious on future timestamps
r7682 hg log -l1 --template '{date|age}\n'
Vadim Gelfer
add tests for command line template....
r1915 hg log --template '{date|date}\n'
hg log --template '{date|isodate}\n'
Giorgos Keramidas
tests: update test-command-template for the new {isodatesec} filter
r6320 hg log --template '{date|isodatesec}\n'
Vadim Gelfer
add tests for command line template....
r1915 hg log --template '{date|rfc822date}\n'
hg log --template '{desc|firstline}\n'
hg log --template '{node|short}\n'
Jesse Glick
Permit XML entities to be escaped in template output....
r6174 hg log --template '<changeset author="{author|xmlescape}"/>\n'
Vadim Gelfer
add tests for command line template....
r1915
Alexis S. L. Carvalho
command line templates: add formatnode filter...
r4352 echo '# formatnode filter works'
echo '# quiet'
Martin Geisler
tests: replace #...# syntax with {...}
r8523 hg -q log -r 0 --template '{node|formatnode}\n'
Alexis S. L. Carvalho
command line templates: add formatnode filter...
r4352 echo '# normal'
Martin Geisler
tests: replace #...# syntax with {...}
r8523 hg log -r 0 --template '{node|formatnode}\n'
Alexis S. L. Carvalho
command line templates: add formatnode filter...
r4352 echo '# verbose'
Martin Geisler
tests: replace #...# syntax with {...}
r8523 hg -v log -r 0 --template '{node|formatnode}\n'
Alexis S. L. Carvalho
command line templates: add formatnode filter...
r4352 echo '# debug'
Martin Geisler
tests: replace #...# syntax with {...}
r8523 hg --debug log -r 0 --template '{node|formatnode}\n'
Alexis S. L. Carvalho
command line templates: add formatnode filter...
r4352
Vadim Gelfer
add tests for command line template....
r1915 echo '# error on syntax'
echo 'x = "f' >> t
hg log
Mads Kiilerich
cmdutil: templating keywords latesttag and latesttagdistance...
r9536 cd ..
echo '# latesttag'
hg init latesttag
cd latesttag
echo a > file
hg ci -Am a -d '0 0'
echo b >> file
hg ci -m b -d '1 0'
echo c >> head1
hg ci -Am h1c -d '2 0'
hg update -q 1
echo d >> head2
hg ci -Am h2d -d '3 0'
echo e >> head2
hg ci -m h2e -d '4 0'
hg merge -q
hg ci -m merge -d '5 0'
echo '# No tag set'
hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
echo '# one common tag: longuest path wins'
hg tag -r 1 -m t1 -d '6 0' t1
hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
echo '# one ancestor tag: more recent wins'
hg tag -r 2 -m t2 -d '7 0' t2
hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
echo '# two branch tags: more recent wins'
hg tag -r 3 -m t3 -d '8 0' t3
hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
echo '# merged tag overrides'
hg tag -r 5 -m t5 -d '9 0' t5
hg tag -r 3 -m at3 -d '10 0' at3
hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
Vadim Gelfer
add tests for command line template....
r1915 echo '# done'