Exemplo n.º 1
0
def _git_merge(branch, local_branches):
    if branch in local_branches:
        git.remove_branch(branch)
    git.checkout(branch)
    git_master_head_local_done = git.get_head("remotes/origin/master")
    git_remote_head_local_done = git.get_head(branch)
    git.get_status()
    git_merge_status = git.merge()
    git_branch_head_merged = git.get_head(branch)
    # sql_info, bsh_info, config_info = git.get_diff()
    git_sql_info, git_bsh_info, git_config_info = None, None, None
    dbcon.execute(
        """update branch set git_master_head_local_done=?, git_remote_head_local_done=?, git_branch_head_merged=?, git_merge_status=?, git_sql_info=?, git_bsh_info=?, git_config_info=?, git_last_update_time=? where branch=?;""",
        (
            git_master_head_local_done,
            git_remote_head_local_done,
            git_branch_head_merged,
            git_merge_status,
            git_sql_info,
            git_bsh_info,
            git_config_info,
            int(time.time()),
            branch,
        ),
    )
Exemplo n.º 2
0
def git_update_remote_heads():
    git.fetch()

    remote_branch_heads = git.get_all_remote_branch_heads(branch_regexp=config.branch_name_regexp)
    dbcon.executemany(
        "insert or ignore into branch(branch, git_remote_head_remote) values (?, ?);", remote_branch_heads
    )
    dbcon.executemany(
        "update branch set git_remote_head_remote=? where branch=?;",
        map(lambda (branch, head): (head, branch), remote_branch_heads),
    )

    git_master_head_remote = git.get_head("remotes/origin/master")
    dbcon.execute("""update branch set git_master_head_remote=?;""", (git_master_head_remote,))