wait-on-file: properly wait on any files and symlink
This make the utility more useful, for example to wait on a lock file.
We also add an explicit -L check since the lock are "weird" symlink.
Differential Revision: https://phab.mercurial-scm.org/D12617
--- a/tests/testlib/wait-on-file Tue Apr 05 04:41:09 2022 +0200
+++ b/tests/testlib/wait-on-file Tue Apr 05 04:43:34 2022 +0200
@@ -29,7 +29,7 @@
touch "$create"
create=""
fi
-while [ "$timer" -gt 0 ] && [ ! -f "$wait_on" ]; do
+while [ "$timer" -gt 0 ] && !([ -e "$wait_on" ] || [ -L "$wait_on" ]) ; do
timer=$(( $timer - 1))
sleep 0.02
done