# HG changeset patch # User Danek Duvall # Date 1377555644 25200 # Node ID 3193b23eec61b95442097514ca479474b6e8dae6 # Parent 5df7118bdcd9462a37a0bca997e9eff9b0199075 solaris: tests can't use tail -n Solaris tail doesn't recognize the -n option. Replace the one use of it with some inline python code, and add a test case to check-code.py. diff -r 5df7118bdcd9 -r 3193b23eec61 contrib/check-code.py --- a/contrib/check-code.py Fri Aug 23 16:05:38 2013 -0700 +++ b/contrib/check-code.py Mon Aug 26 15:20:44 2013 -0700 @@ -67,6 +67,7 @@ (r'echo -n', "don't use 'echo -n', use printf"), (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), (r'head -c', "don't use 'head -c', use 'dd'"), + (r'tail -n', "don't use the '-n' option to tail, just use '-'"), (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"), (r'printf.*[^\\]\\([1-9]|0\d)', "don't use 'printf \NNN', use Python"), diff -r 5df7118bdcd9 -r 3193b23eec61 tests/test-import-merge.t --- a/tests/test-import-merge.t Fri Aug 23 16:05:38 2013 -0700 +++ b/tests/test-import-merge.t Mon Aug 26 15:20:44 2013 -0700 @@ -129,7 +129,9 @@ $ echo a>>a $ hg ci -m3 $ hg export 2 | head -7 > ../a.patch - $ hg export tip | tail -n +8 >> ../a.patch + $ hg export tip > out + >>> apatch = open("../a.patch", "a") + >>> apatch.write("".join(open("out").readlines()[7:])) $ cd .. $ hg clone -qr0 repo3 repo3-clone