# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1675770165 -3600
#      Tue Feb 07 12:42:45 2023 +0100
# Node ID 93d72a7dd4862dd87306eed217f6521209e37574
# Parent  09367b3d23d89b6ac62d85b7764d2f0c57eda4ce
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.

diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -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