##// END OF EJS Templates
sharesafe: introduce config to disallow outdated shares if upgrade fails...
Pulkit Goyal -
r46856:d159d0fa default
parent child Browse files
Show More
@@ -1084,6 +1084,11 b' coreconfigitem('
1084 1084 )
1085 1085 coreconfigitem(
1086 1086 b'experimental',
1087 b'sharesafe-auto-upgrade-fail-error',
1088 default=False,
1089 )
1090 coreconfigitem(
1091 b'experimental',
1087 1092 b'sharesafe-warn-outdated-shares',
1088 1093 default=True,
1089 1094 )
@@ -257,7 +257,12 b' def upgrade_share_to_safe(ui, hgvfs, sto'
257 257 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
258 258 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
259 259 except error.LockError as e:
260 if ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
260 if ui.configbool(b'experimental', b'sharesafe-auto-upgrade-fail-error'):
261 raise error.Abort(
262 _(b'failed to upgrade share, got error: %s')
263 % stringutil.forcebytestr(e.strerror)
264 )
265 elif ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
261 266 ui.warn(
262 267 _(b'failed to upgrade share, got error: %s\n')
263 268 % stringutil.forcebytestr(e.strerror)
@@ -557,6 +557,10 b' Check that if lock is taken, upgrade fai'
557 557 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
558 558
559 559
560 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-auto-upgrade-fail-error=true
561 abort: failed to upgrade share, got error: Lock held
562 [255]
563
560 564 $ rm ../nss-share/.hg/wlock
561 565 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
562 566 repository upgraded to use share-safe mode
General Comments 0
You need to be logged in to leave comments. Login now