test-fix: fix use of 'f --newer' to check that foo.whole is not updated
Here we want to assert not 'mtime(foo.whole.orig) < mtime(foo.whole)'.
The condition has to be inverted since 'f --newer' says "newer" if the
mtimes match.
Alternatively, we could insert 'sleep 2' before 'cp' to ensure that
foo.whole.orig is newer than foo.whole, but a fewer sleeps should be
better.
--- a/tests/test-fix.t Thu Apr 19 19:55:51 2018 +0900
+++ b/tests/test-fix.t Thu Apr 19 22:12:10 2018 +0900
@@ -493,11 +493,11 @@
$ printf "NO FIX NEEDED\n" > foo.whole
$ hg add
adding foo.whole
- $ cp foo.whole foo.whole.orig
+ $ cp -p foo.whole foo.whole.orig
$ sleep 2 # mtime has a resolution of one or two seconds.
$ hg fix --working-dir
- $ f foo.whole --newer foo.whole.orig
- foo.whole: older than foo.whole.orig
+ $ f foo.whole.orig --newer foo.whole
+ foo.whole.orig: newer than foo.whole
$ cd ..