当前位置: 首页>>代码示例>>Python>>正文


Python Git.branches方法代码示例

本文整理汇总了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)
开发者ID:andrerocker,项目名称:bricklayer,代码行数:37,代码来源:service.py

示例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}))
开发者ID:rsampaio,项目名称:bricklayer,代码行数:7,代码来源:rest.py


注:本文中的git.Git.branches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。