equal
deleted
inserted
replaced
555 # if .hg/requires contains the sharesafe requirement, it means |
555 # if .hg/requires contains the sharesafe requirement, it means |
556 # there exists a `.hg/store/requires` too and we should read it |
556 # there exists a `.hg/store/requires` too and we should read it |
557 # NOTE: presence of SHARESAFE_REQUIREMENT imply that store requirement |
557 # NOTE: presence of SHARESAFE_REQUIREMENT imply that store requirement |
558 # is present. We never write SHARESAFE_REQUIREMENT for a repo if store |
558 # is present. We never write SHARESAFE_REQUIREMENT for a repo if store |
559 # is not present, refer checkrequirementscompat() for that |
559 # is not present, refer checkrequirementscompat() for that |
|
560 # |
|
561 # However, if SHARESAFE_REQUIREMENT is not present, it means that the |
|
562 # repository was shared the old way. We check the share source .hg/requires |
|
563 # for SHARESAFE_REQUIREMENT to detect whether the current repository needs |
|
564 # to be reshared |
560 if requirementsmod.SHARESAFE_REQUIREMENT in requirements: |
565 if requirementsmod.SHARESAFE_REQUIREMENT in requirements: |
561 |
566 |
562 if ( |
567 if ( |
563 shared |
568 shared |
564 and requirementsmod.SHARESAFE_REQUIREMENT |
569 and requirementsmod.SHARESAFE_REQUIREMENT |
573 storevfs = vfsmod.vfs(sharedvfs.join(b'store')) |
578 storevfs = vfsmod.vfs(sharedvfs.join(b'store')) |
574 else: |
579 else: |
575 storevfs = vfsmod.vfs(hgvfs.join(b'store')) |
580 storevfs = vfsmod.vfs(hgvfs.join(b'store')) |
576 |
581 |
577 requirements |= _readrequires(storevfs, False) |
582 requirements |= _readrequires(storevfs, False) |
|
583 elif shared: |
|
584 sourcerequires = _readrequires(sharedvfs, False) |
|
585 if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires: |
|
586 ui.warn( |
|
587 _( |
|
588 b'warning: source repository supports share-safe functionality.' |
|
589 b' Reshare to upgrade.\n' |
|
590 ) |
|
591 ) |
578 |
592 |
579 # The .hg/hgrc file may load extensions or contain config options |
593 # The .hg/hgrc file may load extensions or contain config options |
580 # that influence repository construction. Attempt to load it and |
594 # that influence repository construction. Attempt to load it and |
581 # process any new extensions that it may have pulled in. |
595 # process any new extensions that it may have pulled in. |
582 if loadhgrc(ui, wdirvfs, hgvfs, requirements, sharedvfs): |
596 if loadhgrc(ui, wdirvfs, hgvfs, requirements, sharedvfs): |