test: explicitly "add" file before some commit in test-keyword.t
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 07 Feb 2023 12:42:45 +0100
changeset 49989 93d72a7dd486
parent 49988 09367b3d23d8
child 49990 ffd19d73518d
test: explicitly "add" file before some commit in test-keyword.t `hg commit -A` will revert the `hg addremove` step if the commit fails. However `hg rollback` currently does not. We are about to improve internal consistency around transaction and dirstate and the behavior of `hg rollback` will align on the other behavior in the process. Before doing so, we make sure the test is using a separate call to `hg add` to avoid the test scenario to be affected by that future change. note: the behavior change for `hg rollback` seems fine as it affect a niche usecase and `hg rollback` usage have been strongly discouraged for a while.
tests/test-keyword.t
--- a/tests/test-keyword.t	Mon Feb 13 19:46:39 2023 +0100
+++ b/tests/test-keyword.t	Tue Feb 07 12:42:45 2023 +0100
@@ -492,7 +492,8 @@
   $ echo '$Id$' > y
   $ echo '$Id$' > z
   $ hg add y
-  $ hg commit -Am "rollback only" z
+  $ hg add z
+  $ hg commit -m "rollback only" z
   $ cat z
   $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
   $ hg --verbose rollback