comparison mercurial/localrepo.py @ 46348:4a58561ace0f stable

share-share: have the hint issue more consistently and point to the right doc This should help user in trouble to find solution in the documentation. Differential Revision: https://phab.mercurial-scm.org/D9841
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Jan 2021 12:23:40 +0100
parents 6e81446bf1d9
children 085294a8c0e0
comparison
equal deleted inserted replaced
46347:5249ac2bc7a4 46348:4a58561ace0f
566 # 566 #
567 # However, if SHARESAFE_REQUIREMENT is not present, it means that the 567 # However, if SHARESAFE_REQUIREMENT is not present, it means that the
568 # repository was shared the old way. We check the share source .hg/requires 568 # repository was shared the old way. We check the share source .hg/requires
569 # for SHARESAFE_REQUIREMENT to detect whether the current repository needs 569 # for SHARESAFE_REQUIREMENT to detect whether the current repository needs
570 # to be reshared 570 # to be reshared
571 hint = _("see `hg help config.format.use-share-safe` for more information")
571 if requirementsmod.SHARESAFE_REQUIREMENT in requirements: 572 if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
572 573
573 if ( 574 if (
574 shared 575 shared
575 and requirementsmod.SHARESAFE_REQUIREMENT 576 and requirementsmod.SHARESAFE_REQUIREMENT
599 ) 600 )
600 elif mismatch_config == b'abort': 601 elif mismatch_config == b'abort':
601 raise error.Abort( 602 raise error.Abort(
602 _( 603 _(
603 b"share source does not support exp-sharesafe requirement" 604 b"share source does not support exp-sharesafe requirement"
604 ) 605 ),
606 hint=hint,
605 ) 607 )
606 else: 608 else:
607 hint = _(
608 "run `hg help config.share.safe-mismatch.source-not-safe`"
609 )
610 raise error.Abort( 609 raise error.Abort(
611 _( 610 _(
612 b"share-safe mismatch with source.\nUnrecognized" 611 b"share-safe mismatch with source.\nUnrecognized"
613 b" value '%s' of `share.safe-mismatch.source-not-safe`" 612 b" value '%s' of `share.safe-mismatch.source-not-safe`"
614 b" set." 613 b" set."
644 elif mismatch_config == b'abort': 643 elif mismatch_config == b'abort':
645 raise error.Abort( 644 raise error.Abort(
646 _( 645 _(
647 b'version mismatch: source uses share-safe' 646 b'version mismatch: source uses share-safe'
648 b' functionality while the current share does not' 647 b' functionality while the current share does not'
649 ) 648 ),
649 hint=hint,
650 ) 650 )
651 else: 651 else:
652 hint = _("run `hg help config.share.safe-mismatch.source-safe`")
653 raise error.Abort( 652 raise error.Abort(
654 _( 653 _(
655 b"share-safe mismatch with source.\nUnrecognized" 654 b"share-safe mismatch with source.\nUnrecognized"
656 b" value '%s' of `share.safe-mismatch.source-safe` set." 655 b" value '%s' of `share.safe-mismatch.source-safe` set."
657 ) 656 )