# HG changeset patch # User Anton Shestakov # Date 2022-12-05 15:37:12 # Node ID 13c0e3b4fd35c8db1987d833779ac9670405af26 # Parent c52435820bbdc14e4c37d5593e54826cd500722c tests: use `test -f` instead of `ls` to see if a file is present (issue6662) ls's exit code when file doesn't exist is 2 on Linux and 1 on NetBSD, so let's use something that's supposedly more portable, since we only care whether the file is there or not. diff --git a/tests/test-status-tracked-key.t b/tests/test-status-tracked-key.t --- a/tests/test-status-tracked-key.t +++ b/tests/test-status-tracked-key.t @@ -165,8 +165,7 @@ update not affecting the tracked set Test upgrade and downgrade ========================== - $ ls .hg/dirstate-tracked-hint - .hg/dirstate-tracked-hint + $ test -f .hg/dirstate-tracked-hint $ hg debugrequires | grep 'tracked' dirstate-tracked-key-v1 @@ -181,9 +180,8 @@ downgrade no revlogs to process - $ ls -1 .hg/dirstate-tracked-hint - ls: *.hg/dirstate-tracked-hint*: $ENOENT$ (glob) - [2] + $ test -f .hg/dirstate-tracked-hint + [1] $ hg debugrequires | grep 'tracked' [1] @@ -198,8 +196,7 @@ upgrade no revlogs to process - $ ls -1 .hg/dirstate-tracked-hint - .hg/dirstate-tracked-hint + $ test -f .hg/dirstate-tracked-hint $ hg debugrequires | grep 'tracked' dirstate-tracked-key-v1 $ cd ..