diff tests/test-share-safe.t @ 46236:eec47efe219d

sharesafe: add functionality to automatically downgrade shares Reasoning is same as previous patch which adds automatic upgrade support. Downgrade is required as if automatic upgrade is enabled, all shares upgrade and then source repository downgrades, shares won't work. We need to downgrade them. Differential Revision: https://phab.mercurial-scm.org/D9680
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 06 Jan 2021 18:31:16 +0530
parents 0babe12ef35d
children 9796cf108e4e
line wrap: on
line diff
--- a/tests/test-share-safe.t	Wed Jan 06 16:18:06 2021 +0530
+++ b/tests/test-share-safe.t	Wed Jan 06 18:31:16 2021 +0530
@@ -484,6 +484,27 @@
   abort: share source does not support exp-sharesafe requirement
   [255]
 
+Testing automatic downgrade of shares when config is set
+
+  $ touch ../ss-share/.hg/wlock
+  $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
+  abort: failed to downgrade share, got error: Lock held
+  [255]
+  $ rm ../ss-share/.hg/wlock
+
+  $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
+  repository downgraded to not use share-safe mode
+  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
+  |
+  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
+  
+
+  $ hg log -GT "{node}: {desc}\n" -R ../ss-share
+  @  f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
+  |
+  o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
+  
+
 
 Testing automatic upgrade of shares when config is set