comparison hgext/evolve.py @ 1191:583f7f03434b stable

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.
author Matt Mackall <mpm@selenic.com>
date Tue, 23 Dec 2014 14:29:16 -0600
parents dbd0733e5840
children a556fff7adcf aa7cdd9d7310
comparison
equal deleted inserted replaced
1190:1df0bf41016c 1191:583f7f03434b
83 elif gboptslist is not None: 83 elif gboptslist is not None:
84 oldmemfilectx = context.memfilectx 84 oldmemfilectx = context.memfilectx
85 def memfilectx(repo, *args, **kwargs): 85 def memfilectx(repo, *args, **kwargs):
86 return oldmemfilectx(*args, **kwargs) 86 return oldmemfilectx(*args, **kwargs)
87 else: 87 else:
88 raise util.Abort('Your Mercurial is too old for this version of Evolve\n' 88 raise ImportError('evolve needs version %s or above' % min(testedwith.split()))
89 'requires version %s or above' % min(testedwith.split()))
90 89
91 90
92 # This extension contains the following code 91 # This extension contains the following code
93 # 92 #
94 # - Extension Helper code 93 # - Extension Helper code