tests/test-share-safe.t
changeset 49194 e4b31016e194
parent 48779 17eaeb06562c
child 49343 4f04bb0d8deb
--- a/tests/test-share-safe.t	Mon Apr 04 19:30:32 2022 +0200
+++ b/tests/test-share-safe.t	Tue Apr 05 05:20:05 2022 +0200
@@ -603,3 +603,36 @@
   |
   o  f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
   
+
+Test automatique upgrade/downgrade of main-repository
+------------------------------------------------------
+
+create an initial repository
+
+  $ hg init auto-upgrade \
+  > --config format.use-share-safe=no
+  $ hg debugbuilddag -R auto-upgrade --new-file .+5
+  $ hg -R auto-upgrade update
+  6 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugformat -R auto-upgrade | grep share-safe
+  share-safe:          no
+
+upgrade it to share-safe automatically
+
+  $ hg status -R auto-upgrade \
+  >     --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
+  >     --config format.use-share-safe=yes
+  automatically upgrading repository to the `share-safe` feature
+  (see `hg help config.format.use-share-safe` for details)
+  $ hg debugformat -R auto-upgrade | grep share-safe
+  share-safe:         yes
+
+downgrade it from share-safe automatically
+
+  $ hg status -R auto-upgrade \
+  >     --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
+  >     --config format.use-share-safe=no
+  automatically downgrading repository from the `share-safe` feature
+  (see `hg help config.format.use-share-safe` for details)
+  $ hg debugformat -R auto-upgrade | grep share-safe
+  share-safe:          no