本文整理匯總了Python中repository.Repository.handle_update方法的典型用法代碼示例。如果您正苦於以下問題:Python Repository.handle_update方法的具體用法?Python Repository.handle_update怎麽用?Python Repository.handle_update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類repository.Repository
的用法示例。
在下文中一共展示了Repository.handle_update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: int
# 需要導入模塊: from repository import Repository [as 別名]
# 或者: from repository.Repository import handle_update [as 別名]
logging.debug("buildfarm mode: create new jobs")
if (len(config.get('repository-url')) == 0):
logging.error("Error: No repository url specified")
sys.exit(1)
log_data = copy.deepcopy(all_log_data)
log_data['is_buildfarm'] = True
log_data['repository'] = config.get('repository-url')
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
# from here on, only one repository is possible
# create a repository instance
repository = Repository(config, database, config.get('repository-url'), config.get('cache-dir'))
repository.handle_update(True, log_data)
# from here on a local copy of the repository is available
# create a list of all jobs
jobs = []
for branch in config.get('build-branch'):
job = {}
job['added_ts'] = int(time.time())
job['repository'] = config.get('repository-url')
job['repository_type'] = repository.repository_type
job['branch'] = branch
if (config.get('build-revision') == 'HEAD'):
job['revision'] = repository.repository_head(repository.full_path, branch)
job['is_head'] = True
else:
job['revision'] = config.get('build-revision')