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

login
register
mail settings
Submitter Matt Mackall
Date Dec. 23, 2014, 8:32 p.m.
Message ID <0328cc92c31148c3761d.1419366745@calx>
Download mbox | patch
Permalink /patch/7211/
State Accepted
Headers show

Comments

Matt Mackall - Dec. 23, 2014, 8:32 p.m.
# HG changeset patch
# User Matt Mackall <mpm@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.
Pierre-Yves David - Dec. 30, 2014, 8:41 p.m.
On 12/23/2014 12:32 PM, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@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

pushed to main, thanks a lot.

Patch

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