mercurial/localrepo.py
changeset 46236 eec47efe219d
parent 46235 0babe12ef35d
child 46238 9796cf108e4e
equal deleted inserted replaced
46235:0babe12ef35d 46236:eec47efe219d
   572         if (
   572         if (
   573             shared
   573             shared
   574             and requirementsmod.SHARESAFE_REQUIREMENT
   574             and requirementsmod.SHARESAFE_REQUIREMENT
   575             not in _readrequires(sharedvfs, True)
   575             not in _readrequires(sharedvfs, True)
   576         ):
   576         ):
   577             raise error.Abort(
   577             if ui.configbool(
   578                 _(b"share source does not support exp-sharesafe requirement")
   578                 b'experimental', b'sharesafe-auto-downgrade-shares'
   579             )
   579             ):
   580 
   580                 # prevent cyclic import localrepo -> upgrade -> localrepo
   581         requirements |= _readrequires(storevfs, False)
   581                 from . import upgrade
       
   582 
       
   583                 upgrade.downgrade_share_to_non_safe(
       
   584                     ui,
       
   585                     hgvfs,
       
   586                     sharedvfs,
       
   587                     requirements,
       
   588                 )
       
   589             else:
       
   590                 raise error.Abort(
       
   591                     _(
       
   592                         b"share source does not support exp-sharesafe requirement"
       
   593                     )
       
   594                 )
       
   595         else:
       
   596             requirements |= _readrequires(storevfs, False)
   582     elif shared:
   597     elif shared:
   583         sourcerequires = _readrequires(sharedvfs, False)
   598         sourcerequires = _readrequires(sharedvfs, False)
   584         if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires:
   599         if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires:
   585             if ui.configbool(b'experimental', b'sharesafe-auto-upgrade-shares'):
   600             if ui.configbool(b'experimental', b'sharesafe-auto-upgrade-shares'):
   586                 # prevent cyclic import localrepo -> upgrade -> localrepo
   601                 # prevent cyclic import localrepo -> upgrade -> localrepo