# HG changeset patch # User Pierre-Yves David # Date 1718151374 -7200 # Node ID 1721d983dd6d2cee333e460344b7953381bce6b1 # Parent 3cf9e52f5e272cd29f61af065aa319cdea970baa inline-changelog: fix pending transaction visibility when splitting We move the name back to the expected name of `changelog.i.a`. diff -r 3cf9e52f5e27 -r 1721d983dd6d mercurial/revlog.py --- a/mercurial/revlog.py Wed Jun 12 02:15:20 2024 +0200 +++ b/mercurial/revlog.py Wed Jun 12 02:16:14 2024 +0200 @@ -1148,7 +1148,14 @@ ) def _divert_index(self): - return self.index_file + b'.a' + index_file = self.index_file + # when we encounter a legacy inline-changelog, split it. However it is + # important to use the expected filename for pending content + # (.a) otherwise hooks won't be seeing the content of the + # pending transaction. + if index_file.endswith(b'.s'): + index_file = self.index_file[:-2] + return index_file + b'.a' def delay(self): assert not self.is_open diff -r 3cf9e52f5e27 -r 1721d983dd6d tests/test-split-legacy-inline-changelog.t --- a/tests/test-split-legacy-inline-changelog.t Wed Jun 12 02:15:20 2024 +0200 +++ b/tests/test-split-legacy-inline-changelog.t Wed Jun 12 02:16:14 2024 +0200 @@ -98,9 +98,7 @@ $ echo b > b $ hg add b $ hg commit -m "second changeset" - pre-txn tip rev: 1 (missing-correct-output !) - warning: ignoring unknown working parent 11b63e930bf2! (known-bad-output !) - pre-txn tip rev: 0 (known-bad-output !) + pre-txn tip rev: 1 $ hg verify checking changesets checking manifests @@ -195,8 +193,7 @@ adding changesets adding manifests adding file changes - pre-txn tip rev: 1 (missing-correct-output !) - pre-txn tip rev: 0 (known-bad-output !) + pre-txn tip rev: 1 added 1 changesets with 1 changes to 1 files $ cd .. @@ -289,8 +286,7 @@ remote: adding changesets remote: adding manifests remote: adding file changes - remote: pre-txn tip rev: 1 (missing-correct-output !) - remote: pre-txn tip rev: 0 (known-bad-output !) + remote: pre-txn tip rev: 1 remote: added 1 changesets with 1 changes to 1 files $ cd ..