changeset 591:012e48e80840

evolve: require Mercurial 2.4 to work
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 23 Oct 2012 17:13:19 +0200
parents 02cadd3dc9f4
children 35c46a780dd6
files hgext/evolve.py
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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