[PATCH EVOLVE] init: don't abort Mercurial on version mismatch

Matt Mackall mpm at selenic.com
Tue Dec 23 20:32:25 UTC 2014


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1419366556 21600
#      Tue Dec 23 14:29:16 2014 -0600
# Node ID 0328cc92c31148c3761d61d24dbf4a6318c8e644
# Parent  0c879e986ce43f0802c6e684e45a4c937843e001
init: don't abort Mercurial on version mismatch

Evolve causes Mercurial to exit if there is a version mismatch, even
if no evolve command is invoked. This is a headache for people who
have to work with multiple versions of Mercurial. Instead, raise an
ImportError, which gives a warning but otherwise allows Mercurial to
run non-evolve commands.

diff -r 0c879e986ce4 -r 0328cc92c311 hgext/evolve.py
--- a/hgext/evolve.py	Sun Dec 14 12:19:40 2014 -0800
+++ b/hgext/evolve.py	Tue Dec 23 14:29:16 2014 -0600
@@ -85,8 +85,7 @@
     def memfilectx(repo, *args, **kwargs):
         return oldmemfilectx(*args, **kwargs)
 else:
-    raise util.Abort('Your Mercurial is too old for this version of Evolve\n'
-                     'requires version %s or above' % min(testedwith.split()))
+    raise ImportError('evolve needs version %s or above' % min(testedwith.split()))
 
 
 # This extension contains the following code


More information about the Mercurial-devel mailing list