diff mercurial/upgrade.py @ 46018:c6a1fa42e325

upgrade: add support to downgrade share safe mode In previous patch we added support to upgrade current repository to use share safe mode. This patch adds support to downgrade to remove share-safe mode. Differential Revision: https://phab.mercurial-scm.org/D9358
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 16 Oct 2020 18:57:55 +0530
parents 705c37f22859
children 6c960b708ac4
line wrap: on
line diff
--- a/mercurial/upgrade.py	Thu Jun 25 13:13:21 2020 +0530
+++ b/mercurial/upgrade.py	Fri Oct 16 18:57:55 2020 +0530
@@ -80,6 +80,7 @@
         requirements.SIDEDATA_REQUIREMENT,
         requirements.COPIESSDC_REQUIREMENT,
         requirements.NODEMAP_REQUIREMENT,
+        requirements.SHARESAFE_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -1470,3 +1471,11 @@
                         b' New shares will be created in safe mode.\n'
                     )
                 )
+            if sharedsafe.name in removedreqs:
+                ui.warn(
+                    _(
+                        b'repository downgraded to not use share safe mode, '
+                        b'existing shares will not work and needs to'
+                        b' be reshared.\n'
+                    )
+                )