• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vcs.bind_to_repo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vcs.bind_to_repo函数的典型用法代码示例。如果您正苦于以下问题:Python bind_to_repo函数的具体用法?Python bind_to_repo怎么用?Python bind_to_repo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bind_to_repo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: update_dist

def update_dist():
    if not os.path.exists(built_dir) or not vcs.is_git_root(built_dir):
        git = vcs.git
        git("clone", remote_built, built_dir)
    else:
        git = vcs.bind_to_repo(vcs.git, built_dir)
        git("fetch")
        if "origin/master" in git("branch", "-a"):
            git("checkout", "master")
            git("merge", "--ff-only", "origin/master")

    git = vcs.bind_to_repo(vcs.git, built_dir)
    git("config", "user.email", "[email protected]")
    git("config", "user.name", "CSS Build Bot")
开发者ID:faozimipa,项目名称:csswg-test,代码行数:14,代码来源:build.py


示例2: add_changeset

def add_changeset(changeset):
    git = vcs.bind_to_repo(vcs.git, built_dir)

    dest_path = os.path.join(built_dir, "source_rev")
    with open(dest_path, "w") as f:
        f.write(changeset)
    git("add", os.path.relpath(dest_path, built_dir))
开发者ID:faozimipa,项目名称:csswg-test,代码行数:7,代码来源:build.py


示例3: get_new_commits

def get_new_commits():
    git = vcs.bind_to_repo(vcs.git, source_dir)
    commit_path = os.path.join(built_dir, "source_rev")
    with open(commit_path) as f:
        prev_commit = f.read().strip()

    commit_range = "%s..%s" % (prev_commit, os.environ['TRAVIS_COMMIT'])
    return reversed(git("log", "--pretty=%H", "-r", commit_range).strip().split("\n"))
开发者ID:faozimipa,项目名称:csswg-test,代码行数:8,代码来源:build.py


示例4: update_source

def update_source():
    if not os.path.exists(hg_dir) or not os.path.exists(os.path.join(hg_dir, ".hg")):
        hg = vcs.hg
        hg("clone", remote_hg, hg_dir)
    else:
        hg = vcs.bind_to_repo(vcs.hg, hg_dir)
        hg("pull")
        hg("update")
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:8,代码来源:build.py


示例5: apply_build_system_fixes

def apply_build_system_fixes():
    fixes = [
        "c017547f65e07bdd889736524d47824d032ba2e8",
        "cb4a737a88aa7e2f4e54383c57ffa2dfae093dcf",
        "ec540343a3e729644c8178dbcf6d063dca20d49f",
    ]
    git = vcs.bind_to_repo(vcs.git, source_dir)
    for fix in fixes:
        git("cherry-pick", "--keep-redundant-commits", fix)
开发者ID:AutomatedTester,项目名称:web-platform-tests,代码行数:9,代码来源:build.py


示例6: update_dist

def update_dist():
    if not os.path.exists(out_dir) or not vcs.is_git_root(out_dir):
        git = vcs.git
        git("clone", remote_git, out_dir)
    else:
        git = vcs.bind_to_repo(vcs.git, out_dir)
        git("fetch")
        if "origin/master" in git("branch", "-a"):
            git("checkout", "master")
            git("merge", "--ff-only", "origin/master")
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:10,代码来源:build.py


示例7: get_new_commits

def get_new_commits():
    hg = vcs.bind_to_repo(vcs.hg, hg_dir)
    commit_path = os.path.join(out_dir, "source_rev")
    if os.path.exists(commit_path):
        with open(commit_path) as f:
            prev_commit = f.read().strip()
        changesets = hg("log", "--template", "{node}\n", "-r", "%s.." % prev_commit).strip().split("\n")[1:]
    else:
        changesets = [hg("log", "--template", "{node}\n", "-r", "tip")]

    return changesets
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:11,代码来源:build.py


示例8: get_new_commits

def get_new_commits():
    git = vcs.bind_to_repo(vcs.git, source_dir)
    commit_path = os.path.join(built_dir, "source_rev")
    with open(commit_path) as f:
        prev_commit = f.read().strip()

    commit_range = "{0!s}..{1!s}".format(prev_commit, os.environ['TRAVIS_COMMIT'])
    commits = git("log", "--pretty=%H", "-r", commit_range).strip()
    if not commits:
        return []
    return reversed(commits.split("\n"))
开发者ID:runt18,项目名称:csswg-test,代码行数:11,代码来源:build.py


示例9: update_git

def update_git(old_files, new_files):
    git = vcs.bind_to_repo(vcs.git, built_dir)

    print old_files - new_files
    for item in old_files - new_files:
        git("rm", item)

    for item in new_files - old_files:
        git("add", item)

    git("add", "-u")
开发者ID:faozimipa,项目名称:csswg-test,代码行数:11,代码来源:build.py


示例10: update_git

def update_git(old_files, new_files):
    git = vcs.bind_to_repo(vcs.git, built_dir)

    removed = sorted(old_files - new_files)
    added = sorted(new_files - old_files)

    for r in grouper(10, removed):
        git("rm", *r)

    for a in grouper(10, added):
        git("add", *a)

    git("add", "-u")
开发者ID:fylith,项目名称:csswg-test,代码行数:13,代码来源:build.py


示例11: push

def push():
    git = vcs.bind_to_repo(vcs.git, out_dir)
    success = False
    for i in range(2):
        try:
            git("push", "origin", "HEAD:master")
        except subprocess.CalledProcessError:
            if i == 0:
                git("fetch", "origin")
                git("rebase", "origin/master")
        else:
            success = True
            break
    if not success:
        print "Push failed"
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:15,代码来源:build.py


示例12: copy_files

def copy_files():
    dist_path = os.path.join(hg_dir, "dist")
    git = vcs.bind_to_repo(vcs.git, out_dir)
    dest_paths = []
    for dir_name, dir_names, file_names in os.walk(dist_path):
        for file_name in file_names:
            src_path = os.path.join(dir_name, file_name)
            rel_path = os.path.relpath(src_path, dist_path)
            dest_path = os.path.join(out_dir, rel_path)
            dest_dir = os.path.dirname(dest_path)
            if not os.path.exists(dest_dir):
                os.makedirs(dest_dir)
            shutil.copy2(src_path, dest_path)
            dest_paths.append(os.path.relpath(dest_path, out_dir))

    return set(dest_paths)
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:16,代码来源:build.py


示例13: get_new_commits

def get_new_commits():
    git = vcs.bind_to_repo(vcs.git, source_dir)
    commit_path = os.path.join(built_dir, "source_rev")
    with open(commit_path) as f:
        prev_commit = f.read().strip()

    if git("rev-parse", "--revs-only", prev_commit).strip() != prev_commit:
        # we don't have prev_commit in current tree, so let's just do what's new
        commit_range = os.environ['TRAVIS_COMMIT_RANGE']
        assert (os.environ["TRAVIS_PULL_REQUEST"] != "false" or
                os.environ["TRAVIS_BRANCH"] != "master")
    else:
        merge_base = git("merge-base", prev_commit, os.environ['TRAVIS_COMMIT']).strip()
        commit_range = "%s..%s" % (merge_base, os.environ['TRAVIS_COMMIT'])

    commits = git("log", "--pretty=%H", "-r", commit_range).strip()
    if not commits:
        return []
    return reversed(commits.split("\n"))
开发者ID:JoneSnow,项目名称:csswg-test,代码行数:19,代码来源:build.py


示例14: maybe_push

def maybe_push():
    if os.environ["TRAVIS_PULL_REQUEST"] != "false":
        return

    if os.environ["TRAVIS_BRANCH"] != "master":
        return

    git = vcs.bind_to_repo(vcs.git, built_dir)

    out = "https://%[email protected]/jgraham/css-test-built.git" % os.environ["TOKEN"]
    git("remote", "add", "out", out, quiet=True)

    for i in range(2):
        try:
            git("push", "out", "HEAD:master")
        except subprocess.CalledProcessError:
            if i == 0:
                git("fetch", "origin")
                git("rebase", "origin/master")
        else:
            return

    raise Exception("Push failed")
开发者ID:faozimipa,项目名称:csswg-test,代码行数:23,代码来源:build.py


示例15: update_git

def update_git():
    git = vcs.bind_to_repo(vcs.git, built_dir)
    git("add", ".")
开发者ID:JoneSnow,项目名称:csswg-test,代码行数:3,代码来源:build.py


示例16: list_current_files

def list_current_files():
    git = vcs.bind_to_repo(vcs.git, built_dir)
    paths = [item for item in git("ls-tree", "-r", "--full-name", "--name-only", "HEAD").split("\n")
             if item and item not in local_files]
    return set(paths)
开发者ID:faozimipa,项目名称:csswg-test,代码行数:5,代码来源:build.py


示例17: update_to_changeset

def update_to_changeset(changeset):
    git = vcs.bind_to_repo(vcs.git, source_dir)
    git("checkout", changeset)
开发者ID:faozimipa,项目名称:csswg-test,代码行数:3,代码来源:build.py


示例18: commit

def commit(changeset):
    git = vcs.bind_to_repo(vcs.git, out_dir)
    hg = vcs.bind_to_repo(vcs.hg, hg_dir)
    msg = hg("log", "-r", changeset, "--template", "{desc}")
    msg = "%s\n\nBuild from revision %s" % (msg, changeset)
    git("commit", "-m", msg)
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:6,代码来源:build.py


示例19: update_to_changeset

def update_to_changeset(changeset):
    hg = vcs.bind_to_repo(vcs.hg, hg_dir)
    hg("update", changeset)
开发者ID:Ms2ger,项目名称:css-test-build,代码行数:3,代码来源:build.py


示例20: __init__

 def __init__(self, root=None):
     if root is None:
         root = hg("root").strip()
     self.root = root
     self.hg = vcs.bind_to_repo(hg, self.root)
开发者ID:ashishrana7,项目名称:firefox,代码行数:5,代码来源:update.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vcs.createprojection函数代码示例发布时间:2022-05-26
下一篇:
Python request.Request类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap