本文整理汇总了Python中repository.Repository.identify_repository_type方法的典型用法代码示例。如果您正苦于以下问题:Python Repository.identify_repository_type方法的具体用法?Python Repository.identify_repository_type怎么用?Python Repository.identify_repository_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类repository.Repository
的用法示例。
在下文中一共展示了Repository.identify_repository_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from repository import Repository [as 别名]
# 或者: from repository.Repository import identify_repository_type [as 别名]
log_data['run_extra_targets'] = job['run_extra_targets']
log_data['test_locales'] = job['test_locales']
log_data['start_time'] = int(time.time())
current_time = time.strftime("%Y-%m-%d_%H%M%S", time.localtime(log_data['start_time']))
log_data['start_time_local'] = current_time
log_data['is_buildfarm'] = True
# create a repository instance
repository = Repository(config, database, log_data['repository'], config.get('cache-dir'))
# do not update the repository again, assume that all necessary updates were fetched during job creation
repository.handle_update(False, log_data)
# from here on a local copy of the repository is available
log_data['repository_type'] = repository.identify_repository_type(repository.full_path)
logging.info("repository: " + log_data['repository'])
if (log_data['is_head'] == 1):
logging.info("building branch/revision: " + log_data['branch'] + '/' + log_data['revision'] + ' (HEAD)')
else:
logging.info("building branch/revision: " + log_data['branch'] + '/' + log_data['revision'])
build_dir_name = str(current_time).replace('-', '') + '_bf_' + log_data['branch']
# the config module ensures that all necessary --run-* options are set
build_dir = repository.copy_repository(build_dir_name, log_data['branch'], log_data['revision'])
build = Build(config, repository, build_dir)