##// END OF EJS Templates
share: rename share-safe warning config...
Pulkit Goyal -
r47051:2eb5fe13 default
parent child Browse files
Show More
@@ -1098,11 +1098,6 b' coreconfigitem('
1098 )
1098 )
1099 coreconfigitem(
1099 coreconfigitem(
1100 b'experimental',
1100 b'experimental',
1101 b'sharesafe-warn-outdated-shares',
1102 default=True,
1103 )
1104 coreconfigitem(
1105 b'experimental',
1106 b'single-head-per-branch',
1101 b'single-head-per-branch',
1107 default=False,
1102 default=False,
1108 )
1103 )
@@ -1921,6 +1916,16 b' coreconfigitem('
1921 default=b'abort',
1916 default=b'abort',
1922 )
1917 )
1923 coreconfigitem(
1918 coreconfigitem(
1919 b'share',
1920 b'safe-mismatch.source-not-safe.warn',
1921 default=True,
1922 )
1923 coreconfigitem(
1924 b'share',
1925 b'safe-mismatch.source-safe.warn',
1926 default=True,
1927 )
1928 coreconfigitem(
1924 b'shelve',
1929 b'shelve',
1925 b'maxbackups',
1930 b'maxbackups',
1926 default=10,
1931 default=10,
@@ -1965,6 +1965,16 b' Alias definitions for revsets. See :hg:`'
1965 source setting
1965 source setting
1966
1966
1967
1967
1968 ``safe-mismatch.source-safe.warn``
1969 Shows a warning on operations if the shared repository does not use
1970 share-safe, but the source repository does.
1971 (default: True)
1972
1973 ``safe-mismatch.source-not-safe.warn``
1974 Shows a warning on operations if the shared repository uses share-safe,
1975 but the source repository does not.
1976 (default: True)
1977
1968 ``storage``
1978 ``storage``
1969 -----------
1979 -----------
1970
1980
@@ -575,6 +575,9 b' def makelocalrepository(baseui, path, in'
575 and requirementsmod.SHARESAFE_REQUIREMENT
575 and requirementsmod.SHARESAFE_REQUIREMENT
576 not in _readrequires(sharedvfs, True)
576 not in _readrequires(sharedvfs, True)
577 ):
577 ):
578 mismatch_warn = ui.configbool(
579 b'share', b'safe-mismatch.source-not-safe.warn'
580 )
578 mismatch_config = ui.config(
581 mismatch_config = ui.config(
579 b'share', b'safe-mismatch.source-not-safe'
582 b'share', b'safe-mismatch.source-not-safe'
580 )
583 )
@@ -592,6 +595,7 b' def makelocalrepository(baseui, path, in'
592 sharedvfs,
595 sharedvfs,
593 requirements,
596 requirements,
594 mismatch_config,
597 mismatch_config,
598 mismatch_warn,
595 )
599 )
596 elif mismatch_config == b'abort':
600 elif mismatch_config == b'abort':
597 raise error.Abort(
601 raise error.Abort(
@@ -618,6 +622,9 b' def makelocalrepository(baseui, path, in'
618 sourcerequires = _readrequires(sharedvfs, False)
622 sourcerequires = _readrequires(sharedvfs, False)
619 if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires:
623 if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires:
620 mismatch_config = ui.config(b'share', b'safe-mismatch.source-safe')
624 mismatch_config = ui.config(b'share', b'safe-mismatch.source-safe')
625 mismatch_warn = ui.configbool(
626 b'share', b'safe-mismatch.source-safe.warn'
627 )
621 if mismatch_config in (
628 if mismatch_config in (
622 b'upgrade-allow',
629 b'upgrade-allow',
623 b'allow',
630 b'allow',
@@ -632,6 +639,7 b' def makelocalrepository(baseui, path, in'
632 storevfs,
639 storevfs,
633 requirements,
640 requirements,
634 mismatch_config,
641 mismatch_config,
642 mismatch_warn,
635 )
643 )
636 elif mismatch_config == b'abort':
644 elif mismatch_config == b'abort':
637 raise error.Abort(
645 raise error.Abort(
@@ -242,7 +242,12 b' def upgraderepo('
242
242
243
243
244 def upgrade_share_to_safe(
244 def upgrade_share_to_safe(
245 ui, hgvfs, storevfs, current_requirements, mismatch_config
245 ui,
246 hgvfs,
247 storevfs,
248 current_requirements,
249 mismatch_config,
250 mismatch_warn,
246 ):
251 ):
247 """Upgrades a share to use share-safe mechanism"""
252 """Upgrades a share to use share-safe mechanism"""
248 wlock = None
253 wlock = None
@@ -282,7 +287,7 b' def upgrade_share_to_safe('
282 _(b'failed to upgrade share, got error: %s')
287 _(b'failed to upgrade share, got error: %s')
283 % stringutil.forcebytestr(e.strerror)
288 % stringutil.forcebytestr(e.strerror)
284 )
289 )
285 elif ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
290 elif mismatch_warn:
286 ui.warn(
291 ui.warn(
287 _(b'failed to upgrade share, got error: %s\n')
292 _(b'failed to upgrade share, got error: %s\n')
288 % stringutil.forcebytestr(e.strerror)
293 % stringutil.forcebytestr(e.strerror)
@@ -298,6 +303,7 b' def downgrade_share_to_non_safe('
298 sharedvfs,
303 sharedvfs,
299 current_requirements,
304 current_requirements,
300 mismatch_config,
305 mismatch_config,
306 mismatch_warn,
301 ):
307 ):
302 """Downgrades a share which use share-safe to not use it"""
308 """Downgrades a share which use share-safe to not use it"""
303 wlock = None
309 wlock = None
@@ -335,6 +341,11 b' def downgrade_share_to_non_safe('
335 _(b'failed to downgrade share, got error: %s')
341 _(b'failed to downgrade share, got error: %s')
336 % stringutil.forcebytestr(e.strerror)
342 % stringutil.forcebytestr(e.strerror)
337 )
343 )
344 elif mismatch_warn:
345 ui.warn(
346 _(b'failed to downgrade share, got error: %s\n')
347 % stringutil.forcebytestr(e.strerror)
348 )
338 finally:
349 finally:
339 if wlock:
350 if wlock:
340 wlock.release()
351 wlock.release()
@@ -546,7 +546,7 b' Check that if lock is taken, upgrade fai'
546 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
546 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
547
547
548
548
549 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config experimental.sharesafe-warn-outdated-shares=false
549 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False
550 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
550 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
551 |
551 |
552 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
552 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
General Comments 0
You need to be logged in to leave comments. Login now