diff tests/test-racy-mutations.t @ 50029:28dfb2df4ab9

commit: use `dirstate.change_files` to scope the associated `addremove` This was significantly more complicated than I expected, because multiple extensions get in the way. I introduced a context that lazily open the transaction and associated context to work around these complication. See the inline documentation for details. Introducing the wrapping transaction remove the need for dirstate-guard (one of the ultimate goal of all this), and slightly affect the result of a `hg rollback` after a `hg commit --addremove`. That last part is deemed fine. It aligns the behavior with what happens after a failed `hg commit --addremove` and nobody should be using `hg rollback` anyway. The small output change in the test come from the different transaction timing and fact the transaction now backup the dirstate before the addremove, which might mean "no file to backup" when the repository starts from an empty state.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Feb 2023 11:51:58 +0100
parents 3997c64eff8b
children dcaa2df1f688
line wrap: on
line diff
--- a/tests/test-racy-mutations.t	Sun Feb 05 15:38:23 2023 +0100
+++ b/tests/test-racy-mutations.t	Wed Feb 15 11:51:58 2023 +0100
@@ -106,10 +106,10 @@
 
 #if fail-if-detected
   $ cat .foo_commit_out
+  note: commit message saved in .hg/last-message.txt
+  note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
   transaction abort!
   rollback completed
-  note: commit message saved in .hg/last-message.txt
-  note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
   abort: 00changelog.i: file cursor at position 249, expected 121
 And no corruption in the changelog.
   $ hg debugrevlogindex -c