# HG changeset patch # User Nicolas Chauvat # Date 1257108003 -3600 # Node ID 3d5abcd7c85206daacfb2abceb14f44b2c849f7f # Parent 82bb2c7f083be4ce01d40bdb472a2ece6d515a97 [migration] warn if 3.5 workflow migration is going to fail diff -r 82bb2c7f083b -r 3d5abcd7c852 misc/migration/bootstrapmigration_repository.py --- a/misc/migration/bootstrapmigration_repository.py Wed Oct 28 20:09:59 2009 +0100 +++ b/misc/migration/bootstrapmigration_repository.py Sun Nov 01 21:40:03 2009 +0100 @@ -31,6 +31,17 @@ session.set_shared_data('do-not-insert-cwuri', False) if applcubicwebversion < (3, 5, 0) and cubicwebversion >= (3, 5, 0): + # check that migration is not doomed + rset = rql('Any X,Y WHERE X transition_of E, Y transition_of E, ' + 'X name N, Y name N, NOT X identity Y', + ask_confirm=False) + if rset: + from logilab.common.shellutils import ASK + if not ASK.confirm('Migration will fail because of transitions with the same name. ' + 'Continue anyway ?'): + import sys + sys.exit(1) + # proceed with migration add_entity_type('Workflow') add_entity_type('BaseTransition') add_entity_type('WorkflowTransition')