evolve: require Mercurial 2.4 to work
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 23 Oct 2012 17:13:19 +0200
changeset 591 012e48e80840
parent 590 02cadd3dc9f4
child 592 35c46a780dd6
evolve: require Mercurial 2.4 to work
hgext/evolve.py
--- a/hgext/evolve.py	Tue Oct 23 17:12:53 2012 +0200
+++ b/hgext/evolve.py	Tue Oct 23 17:13:19 2012 +0200
@@ -29,18 +29,11 @@
 
 try:
     from mercurial import obsolete
+    getattr(obsolete, 'getrevs') # 2.4 specific
     if not obsolete._enabled:
         obsolete._enabled = True
-except ImportError:
-    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
+except (ImportError, AttributeError):
+    raise util.Abort('Evolve extension requires Mercurial 2.4 (or later)')
 
 
 from mercurial import bookmarks