obsolete: prevent options from being used without createmarkers
authorDurham Goode <durham@fb.com>
Tue, 14 Oct 2014 13:27:00 -0700
changeset 22954 32f15b361f36
parent 22953 b1d694d3975e
child 22955 fab9dda0f2a3
obsolete: prevent options from being used without createmarkers exchange and allowunstable should only be enabled if createmarkers is enabled, so check for that and raise an exception if that's not the case.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Tue Oct 14 13:26:01 2014 -0700
+++ b/mercurial/obsolete.py	Tue Oct 14 13:27:00 2014 -0700
@@ -1165,4 +1165,10 @@
     if len(result) == 0 and _enabled:
         return True
 
+    # createmarkers must be enabled if other options are enabled
+    if ((allowunstableopt in result or exchangeopt in result) and
+        not createmarkersopt in result):
+        raise util.Abort(_("'createmarkers' obsolete option must be enabled "
+                           "if other obsolete options are enabled"))
+
     return option in result