comparison mercurial/upgrade_utils/actions.py @ 46230:1fcab88ab85c

downgrade: if a compression is removed, consider that too For compression format variant, the result of `fromrepo()` and `fromconfig()` is not a boolean and we have to actually equate those to find change. Differential Revision: https://phab.mercurial-scm.org/D9693
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 08 Jan 2021 23:06:38 +0530
parents 3f92a9bb80f0
children 6e81446bf1d9
comparison
equal deleted inserted replaced
46229:52abb1af2995 46230:1fcab88ab85c
465 because of disabled config option for them""" 465 because of disabled config option for them"""
466 466
467 downgrades = [] 467 downgrades = []
468 468
469 for fv in allformatvariant: 469 for fv in allformatvariant:
470 if fv.name == b'compression':
471 # If there is a compression change between repository
472 # and config, destination repository compression will change
473 # and current compression will be removed.
474 if fv.fromrepo(repo) != fv.fromconfig(repo):
475 downgrades.append(fv)
476 continue
470 # format variant exist in repo but does not exist in new repository 477 # format variant exist in repo but does not exist in new repository
471 # config 478 # config
472 if fv.fromrepo(repo) and not fv.fromconfig(repo): 479 if fv.fromrepo(repo) and not fv.fromconfig(repo):
473 downgrades.append(fv) 480 downgrades.append(fv)
474 481