##// 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 coreconfigitem(
1085 coreconfigitem(
1086 b'experimental',
1086 b'experimental',
1087 b'sharesafe-auto-upgrade-fail-error',
1088 default=False,
1089 )
1090 coreconfigitem(
1091 b'experimental',
1087 b'sharesafe-warn-outdated-shares',
1092 b'sharesafe-warn-outdated-shares',
1088 default=True,
1093 default=True,
1089 )
1094 )
@@ -257,7 +257,12 b' def upgrade_share_to_safe(ui, hgvfs, sto'
257 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
257 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
258 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
258 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
259 except error.LockError as e:
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 ui.warn(
266 ui.warn(
262 _(b'failed to upgrade share, got error: %s\n')
267 _(b'failed to upgrade share, got error: %s\n')
263 % stringutil.forcebytestr(e.strerror)
268 % stringutil.forcebytestr(e.strerror)
@@ -557,6 +557,10 b' Check that if lock is taken, upgrade fai'
557 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
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 $ rm ../nss-share/.hg/wlock
564 $ rm ../nss-share/.hg/wlock
561 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
565 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
562 repository upgraded to use share-safe mode
566 repository upgraded to use share-safe mode
General Comments 0
You need to be logged in to leave comments. Login now