[migration] abort becomes possible when asked for confirmation before migration script stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Fri, 12 Feb 2010 12:13:07 +0100
branchstable
changeset 4553 23201259ffeb
parent 4549 2832da80d9b7
child 4556 43c14e0e8972
[migration] abort becomes possible when asked for confirmation before migration script
migration.py
--- a/migration.py	Wed Feb 10 15:49:20 2010 +0100
+++ b/migration.py	Fri Feb 12 12:13:07 2010 +0100
@@ -70,8 +70,11 @@
     ability to show the script's content
     """
     while True:
-        answer = ASK.ask('Execute %r ?' % scriptpath, ('Y','n','show'), 'Y')
-        if answer == 'n':
+        answer = ASK.ask('Execute %r ?' % scriptpath,
+                         ('Y','n','show','abort'), 'Y')
+        if answer == 'abort':
+            raise SystemExit(1)
+        elif answer == 'n':
             return False
         elif answer == 'show':
             stream = open(scriptpath)