if module['name'] in moduleNames: moduleNames.remove(module['name']) if args.dry_run: print('\t"%s"' % module['name']) performedDelete = True else: try: svn.delete(module['systemPath']) performedDelete = True print('\t', module['name']) except svn.SvnError as e: log.error(e.message + '\n') print('Skipping SVN commit for %s' % repo['path']) break else: if performedDelete: if args.dry_run: print('\n"SVN commit"', repo['path']) else: try: svn.commit(repo['path'], 'Deleting modules with ' 'delete_modules.py script') except svn.SvnError as e: log.error(e.message + '\n') if len(moduleNames) > 0: print('\nThe following modules were not present to delete:') for name in moduleNames: print('\t', name)
except subprocess.CalledProcessError as e: log.error(e.message) continue # Compile Sass. sassCommand = ['compass', 'compile', target['path']] if args.dry_run: print '"Compile Sass" with %s' % sassCommand else: try: log.info('Compiling Sass: %s', sassCommand) subprocess.check_call(sassCommand) except subprocess.CalledProcessError as e: log.error(e.message) log.error('Sass compilation error, skipping commit.') continue # Clean up svn status and commit. if args.dry_run: print '"Clean" SVN status for %s' % target['path'] print '"SVN commit" for %s' % target['path'] else: try: svn.cleanRepo(target['path']) svn.commit(target['path'], 'Syncing styles with sync_styles.py script.') except svn.SvnError as e: log.error(e.message) continue
continue # SVN update & commit if reposWithErrors.get(repo['path'], False): log.warning('A previous migration in this script run modifying ' 'the project "%s" had errors. Skipping SVN commit so that the ' 'bad migration can be fixed. Please address errors and re-run ' 'the script or commit manually.', repo['path']) elif args.skip_commit: logging.info('Skipping SVN Commit. You must commit manually to ' 'save changes.') else: try: svn.cleanRepo(repo['path']) svn.commit(repo['path'], 'Migrating from %s non-modular widget ' 'to modular widgets in %s using migrate.py' %( widgetDir, moduleDir)) except svn.SvnError as e: log.error(e.message) log.error('Unable to commit migration of %s to %s\n', widgetDir, moduleDir) print '\n' # Report results if len(reposWithErrors): log.error('Some errors were encountered during this migration. See the ' 'logs for details.') uncommitedRepos = [] unchangedRepos = [] for key, value in reposWithErrors.iteritems():
'from %s to %s. Skipping\n', sourceName, targetName) continue print('Syncing modules from "%s" to "%s"' % (sourceName, targetName)) sourceInfo = list_modules.getModuleInfo(source['path']) targetInfo = list_modules.getModuleInfo(target['path']) modulesToSync = _getModulesToSync(sourceInfo, targetInfo, moduleNames) # Don't clean & commit if we're not going to move anything. if len(modulesToSync) == 0: continue try: _syncModules(modulesToSync, target) except Exception as e: log.error('Error syncing modules to "%s", skipping commit.\n', target['path']) continue if args.dry_run: print('\n"Clean" SVN status for', target['path']) print('\n"SVN commit"', target['path']) else: try: svn.cleanRepo(target['path']) svn.commit(target['path'], 'Copying modules from ' + sourceName + ' using sync_modules.py.') except svn.SvnError as e: log.error(e.message + '\n')