evolve: detect and abort if 2.4 is detected stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 23 Oct 2012 15:05:32 +0200
branchstable
changeset 585 f013ca072bd9
parent 584 af3b0d696e7f
child 586 f01721161532
evolve: detect and abort if 2.4 is detected The meaning of critical attribut have changed in 2.4
hgext/evolve.py
--- a/hgext/evolve.py	Tue Oct 23 15:03:25 2012 +0200
+++ b/hgext/evolve.py	Tue Oct 23 15:05:32 2012 +0200
@@ -32,7 +32,16 @@
     if not obsolete._enabled:
         obsolete._enabled = True
 except ImportError:
-    raise util.Abort('Obsolete extension requires Mercurial 2.3 (or later)')
+    raise util.Abort('Evolve extension requires Mercurial 2.3 (or later)')
+
+try:
+    getattr(obsolete, 'getrevs') # 2.4 specific
+    raise util.Abort('Your version of Mercurial is too recent for this '
+                     'version of evolve',
+                     hint="upgrade your evolve")
+except AttributeError:
+    pass
+
 
 from mercurial import bookmarks
 from mercurial import cmdutil