def cleanup(self, args): """Cleanup exported repositories.""" config = Config(args.projects_file) for repo in config.get_repos(): if args.repos is None or \ repo.name in args.repos.split(','): repo.cleanup()
def analyze(self, args): """Analyze repos if they were migrated successfuly.""" config = Config(args.projects_file) for repo in config.get_repos(): if args.repos is None or \ repo.name in args.repos.split(','): repo.analyze() call('rm -rf %s' % config.analyze_path)
def export(self, args): """Export from svn-mirror to git repository""" config = Config(args.projects_file) if args.svn_repos is not None: svn_repos_to_process = args.svn_repos.split(',') else: svn_repos_to_process = [i.name for i in config.svn_repos] for svn_repo in config.svn_repos: if svn_repo.name in svn_repos_to_process: svn_repo.export(path(args.authors_file), args.repos)
def publish(self, args): """Publish repos to github""" #import logging #logging.basicConfig(level=logging.DEBUG) gh = Github(username=args.username, api_token=args.api_token) config = Config(args.projects_file) for repo in config.get_repos(): if args.repos is None or \ repo.name in args.repos.split(','): repo.publish(gh)
def sync(self, args): """Create svn mirror, if they don't exists, and sync svn repositories.""" config = Config(args.projects_file) if args.svn_repos is not None: svn_repos_to_process = args.svn_repos.split(',') else: svn_repos_to_process = [i.name for i in config.svn_repos] for svn_repo in config.svn_repos: if svn_repo.name in svn_repos_to_process: svn_repo.initialize() for svn_repo in config.svn_repos: if svn_repo.name in svn_repos_to_process: svn_repo.sync()
def status(self, args): """Show status""" config = Config(args.projects_file) if args.repos is not None: repos_to_process = args.repos.split(',') else: repos_to_process = [i.name for i in config.get_repos()] header('Status report') for repo in config.get_repos(): if repo.name in repos_to_process: status = repo.status.split('\n') line('%s: %s' % (repo.name, status[0])) for item in status[1:]: line(item, 1) line('')