本文整理汇总了Python中git.Git.branches方法的典型用法代码示例。如果您正苦于以下问题:Python Git.branches方法的具体用法?Python Git.branches怎么用?Python Git.branches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git.Git
的用法示例。
在下文中一共展示了Git.branches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sched_builder
# 需要导入模块: from git import Git [as 别名]
# 或者: from git.Git import branches [as 别名]
def sched_builder(self):
for project in sorted(Project.get_all(), key=lambda p: p.name):
if (project.name == ""):
continue
try:
log.msg("checking project: %s" % project.name)
if project.is_building():
log.msg("project %s still building, skip" % project.name)
continue
branch = "master"
git = Git(project)
if os.path.isdir(git.workdir):
git.checkout_branch(branch)
git.pull()
else:
git.clone(branch)
if not os.path.isdir(git.workdir):
continue
for remote_branch in git.branches(remote=True):
git.checkout_remote_branch(remote_branch.replace('origin/', ''))
for release in ('stable', 'testing', 'unstable'):
if project.last_tag(release) != git.last_tag(release):
try:
_, version = git.last_tag(release).split('_')
log.msg("new %s tag, building version: %s" % (release, version))
d = threads.deferToThread(self.send_job, project.name, branch, release, version)
except Exception, e:
log.msg("tag not parsed: %s:%s" % (project.name, git.last_tag(release)))
except Exception, e:
log.err(e)
示例2: get
# 需要导入模块: from git import Git [as 别名]
# 或者: from git.Git import branches [as 别名]
def get(self, project_name):
project = Projects(project_name)
git = Git(project)
branches = git.branches(remote=True)
self.write(cyclone.escape.json_encode({"branches": branches}))