InternalKieModule currentKM = currentReleaseId.equals( newReleaseId ) && !currentReleaseId.equals(kr.getDefaultReleaseId()) ?
(InternalKieModule) ((KieRepositoryImpl)kr).getOldKieModule( currentReleaseId ) :
(InternalKieModule) kr.getKieModule( currentReleaseId );
InternalKieModule newKM = (InternalKieModule) kr.getKieModule( newReleaseId );
ChangeSetBuilder csb = new ChangeSetBuilder();
KieJarChangeSet cs = csb.build( currentKM, newKM );
((KieModuleKieProject) kProject).updateToModule( newKM );
List<String> kbasesToRemove = new ArrayList<String>();
for( Map.Entry<String, KieBase> kBaseEntry : kBases.entrySet() ) {