mercurial/upgrade_utils/actions.py
changeset 49069 a31e9840178e
parent 48946 642e31cb55f0
child 49186 801ef401597e
equal deleted inserted replaced
49065:5d205e476057 49069:a31e9840178e
    35 
    35 
    36 
    36 
    37 def preservedrequirements(repo):
    37 def preservedrequirements(repo):
    38     preserved = {
    38     preserved = {
    39         requirements.SHARED_REQUIREMENT,
    39         requirements.SHARED_REQUIREMENT,
       
    40         requirements.NARROW_REQUIREMENT,
    40     }
    41     }
    41     return preserved & repo.requirements
    42     return preserved & repo.requirements
    42 
    43 
    43 
    44 
    44 FORMAT_VARIANT = b'deficiency'
    45 FORMAT_VARIANT = b'deficiency'
  1002 
  1003 
  1003 
  1004 
  1004 def supporteddestrequirements(repo):
  1005 def supporteddestrequirements(repo):
  1005     """Obtain requirements that upgrade supports in the destination.
  1006     """Obtain requirements that upgrade supports in the destination.
  1006 
  1007 
  1007     If the result of the upgrade would create requirements not in this set,
  1008     If the result of the upgrade would have requirements not in this set,
  1008     the upgrade is disallowed.
  1009     the upgrade is disallowed.
  1009 
  1010 
  1010     Extensions should monkeypatch this to add their custom requirements.
  1011     Extensions should monkeypatch this to add their custom requirements.
  1011     """
  1012     """
  1012     supported = {
  1013     supported = {
  1022         requirements.REVLOGV2_REQUIREMENT,
  1023         requirements.REVLOGV2_REQUIREMENT,
  1023         requirements.SHARED_REQUIREMENT,
  1024         requirements.SHARED_REQUIREMENT,
  1024         requirements.SHARESAFE_REQUIREMENT,
  1025         requirements.SHARESAFE_REQUIREMENT,
  1025         requirements.SPARSEREVLOG_REQUIREMENT,
  1026         requirements.SPARSEREVLOG_REQUIREMENT,
  1026         requirements.STORE_REQUIREMENT,
  1027         requirements.STORE_REQUIREMENT,
       
  1028         requirements.NARROW_REQUIREMENT,
  1027     }
  1029     }
  1028     for name in compression.compengines:
  1030     for name in compression.compengines:
  1029         engine = compression.compengines[name]
  1031         engine = compression.compengines[name]
  1030         if engine.available() and engine.revlogheader():
  1032         if engine.available() and engine.revlogheader():
  1031             supported.add(b'exp-compression-%s' % name)
  1033             supported.add(b'exp-compression-%s' % name)