changeset 22954:32f15b361f36

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.
author Durham Goode <durham@fb.com>
date Tue, 14 Oct 2014 13:27:00 -0700
parents b1d694d3975e
children fab9dda0f2a3
files mercurial/obsolete.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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