# HG changeset patch # User Pierre-Yves David # Date 2022-08-31 03:48:32 # Node ID 486b8a3831006b51b38534bf1ead0d0b18e6c0d4 # Parent 6b4ad07b4d694970085ef9767912807a3f5fefcd dirstate-v2: display a possible issue with transaction If we backup the dirstate without the data file, we can end up in an inconsistent state of the transaction is rolled back. diff --git a/tests/test-dirstate.t b/tests/test-dirstate.t --- a/tests/test-dirstate.t +++ b/tests/test-dirstate.t @@ -213,3 +213,41 @@ Check that unused bytes counter is reset #endif +Transaction compatibility +------------------------- + +The transaction preserves the dirstate. +We should make sure all of it (docket + data) is preserved + +#if dirstate-v2 + $ hg commit -m 'bli' +#endif + + $ hg update --quiet + $ hg revert --all --quiet + $ rm -f a + $ echo foo > foo + $ hg add foo + $ hg commit -m foo + +#if dirstate-v2 + $ uid=$(find_dirstate_uuid) + $ touch bar + $ while [ uid = $(find_dirstate_uuid) ]; do + > hg add bar; + > hg remove bar; + > done; + $ rm bar +#endif + $ hg rollback + repository tip rolled back to revision 1 (undo commit) + working directory now based on revision 1 + +#if dirstate-v1 + $ hg status + A foo +#else + $ hg status + abort: $ENOENT$: '*/.hg/dirstate.*' (glob) (known-bad-output !) + [255] +#endif