comparison mercurial/revlog.py @ 51635:1721d983dd6d stable

inline-changelog: fix pending transaction visibility when splitting We move the name back to the expected name of `changelog.i.a`.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 12 Jun 2024 02:16:14 +0200
parents 3cf9e52f5e27
children d6c895e4adc4
comparison
equal deleted inserted replaced
51634:3cf9e52f5e27 51635:1721d983dd6d
1146 dfh.tell() if dfh else None, 1146 dfh.tell() if dfh else None,
1147 sdfh.tell() if sdfh else None, 1147 sdfh.tell() if sdfh else None,
1148 ) 1148 )
1149 1149
1150 def _divert_index(self): 1150 def _divert_index(self):
1151 return self.index_file + b'.a' 1151 index_file = self.index_file
1152 # when we encounter a legacy inline-changelog, split it. However it is
1153 # important to use the expected filename for pending content
1154 # (<radix>.a) otherwise hooks won't be seeing the content of the
1155 # pending transaction.
1156 if index_file.endswith(b'.s'):
1157 index_file = self.index_file[:-2]
1158 return index_file + b'.a'
1152 1159
1153 def delay(self): 1160 def delay(self):
1154 assert not self.is_open 1161 assert not self.is_open
1155 if self.inline: 1162 if self.inline:
1156 msg = "revlog with delayed write should not be inline" 1163 msg = "revlog with delayed write should not be inline"