comparison mercurial/upgrade_utils/engine.py @ 47659:f030c7d22032

walk: no longer ignore revlogs of files starting with `undo.` (issue6542) Changeset 0b569c75d180 introduced new code in store.walk to filter out undo files left behind by the transaction. However doing so is also filtering out legitimate revlog file starting with `undo.` So this changeset is mostly rolling back that change and adding tests tests to catch this kind of error in the future. As a result we the transaction undo files a considered again by various code (in practice mostly persistent nodemap related). We either live with it (low inconvenient) or explicitly work around it for now. This should be good enough to no longer block the 5.9rc release with this issue. We shall build something cleaner within the 6.0 cycle. Differential Revision: https://phab.mercurial-scm.org/D11201
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 22:39:08 +0200
parents a43d256c041a
children aa2296893168
comparison
equal deleted inserted replaced
47658:f0cf560475a3 47659:f030c7d22032
198 # source files and allows a unified progress bar to be displayed. 198 # source files and allows a unified progress bar to be displayed.
199 for rl_type, unencoded, encoded, size in alldatafiles: 199 for rl_type, unencoded, encoded, size in alldatafiles:
200 if not rl_type & store.FILEFLAGS_REVLOG_MAIN: 200 if not rl_type & store.FILEFLAGS_REVLOG_MAIN:
201 continue 201 continue
202 202
203 # the store.walk function will wrongly pickup transaction backup and
204 # get confused. As a quick fix for 5.9 release, we ignore those.
205 # (this is not a module constants because it seems better to keep the
206 # hack together)
207 skip_undo = (
208 b'undo.backup.00changelog.i',
209 b'undo.backup.00manifest.i',
210 )
211 if unencoded in skip_undo:
212 continue
213
203 rl = _revlogfrompath(srcrepo, rl_type, unencoded) 214 rl = _revlogfrompath(srcrepo, rl_type, unencoded)
204 215
205 info = rl.storageinfo( 216 info = rl.storageinfo(
206 exclusivefiles=True, 217 exclusivefiles=True,
207 revisionscount=True, 218 revisionscount=True,