mercurial/obsolete.py
branchstable
changeset 47794 2cd00052ae4d
parent 47061 ba6881c6a178
child 48700 4507bc001365
--- a/mercurial/obsolete.py	Wed Jul 28 13:47:21 2021 +0300
+++ b/mercurial/obsolete.py	Wed Jul 28 13:45:07 2021 +0300
@@ -144,20 +144,16 @@
     """Returns dicts showing state of obsolescence features."""
 
     createmarkersvalue = _getoptionvalue(repo, createmarkersopt)
-    unstablevalue = _getoptionvalue(repo, allowunstableopt)
-    divergencevalue = _getoptionvalue(repo, allowdivergenceopt)
-    exchangevalue = _getoptionvalue(repo, exchangeopt)
-
-    # createmarkers must be enabled if other options are enabled
-    if (
-        unstablevalue or divergencevalue or exchangevalue
-    ) and not createmarkersvalue:
-        raise error.Abort(
-            _(
-                b"'createmarkers' obsolete option must be enabled "
-                b"if other obsolete options are enabled"
-            )
-        )
+    if createmarkersvalue:
+        unstablevalue = _getoptionvalue(repo, allowunstableopt)
+        divergencevalue = _getoptionvalue(repo, allowdivergenceopt)
+        exchangevalue = _getoptionvalue(repo, exchangeopt)
+    else:
+        # if we cannot create obsolescence markers, we shouldn't exchange them
+        # or perform operations that lead to instability or divergence
+        unstablevalue = False
+        divergencevalue = False
+        exchangevalue = False
 
     return {
         createmarkersopt: createmarkersvalue,