comparison mercurial/upgrade.py @ 45997:7c539f0febbe

upgrade: add an explicite --filelogs arguments This make it possible to select no revlog for upgrade, which is useful for some upgrade target or in some specific cases (eg: persistent-nodemap or share-safe update). Differential Revision: https://phab.mercurial-scm.org/D9468
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 30 Nov 2020 14:06:45 +0100
parents 32dcd783a985
children 705c37f22859
comparison
equal deleted inserted replaced
45996:904647f7d983 45997:7c539f0febbe
1150 run=False, 1150 run=False,
1151 optimize=None, 1151 optimize=None,
1152 backup=True, 1152 backup=True,
1153 manifest=None, 1153 manifest=None,
1154 changelog=None, 1154 changelog=None,
1155 filelogs=None,
1155 ): 1156 ):
1156 """Upgrade a repository in place.""" 1157 """Upgrade a repository in place."""
1157 if optimize is None: 1158 if optimize is None:
1158 optimize = [] 1159 optimize = []
1159 optimize = {legacy_opts_map.get(o, o) for o in optimize} 1160 optimize = {legacy_opts_map.get(o, o) for o in optimize}
1160 repo = repo.unfiltered() 1161 repo = repo.unfiltered()
1161 1162
1162 revlogs = set(UPGRADE_ALL_REVLOGS) 1163 revlogs = set(UPGRADE_ALL_REVLOGS)
1163 specentries = ( 1164 specentries = (
1164 (UPGRADE_CHANGELOG, changelog), 1165 (UPGRADE_CHANGELOG, changelog),
1165 (UPGRADE_MANIFEST, manifest) 1166 (UPGRADE_MANIFEST, manifest),
1167 (UPGRADE_FILELOGS, filelogs),
1166 ) 1168 )
1167 specified = [(y, x) for (y, x) in specentries if x is not None] 1169 specified = [(y, x) for (y, x) in specentries if x is not None]
1168 if specified: 1170 if specified:
1169 # we have some limitation on revlogs to be recloned 1171 # we have some limitation on revlogs to be recloned
1170 if any(x for y, x in specified): 1172 if any(x for y, x in specified):