예제 #1
0
def dump():
    """Print raw config info."""
    print("-----Git Branches-----")
    git.branch("-vv", _out=gitout)

    print()
    print("-----Git Remotes-----")
    git.remote("-v", "show", _out=gitout)
예제 #2
0
def set_branch_master_tracking():
    """Set branch 'master' to track remote 'personal'.

    Should only be called if the URL for 'personal' is set.
    """
    if branch_master_tracking_personal():
        info("Branch 'master' already tracking 'personal'.")
    else:
        try:
            # start by fetching, since Git won't set the upstream repo
            # for a branch if there isn't a local copy yet
            git.fetch("personal")
            git.branch("--set-upstream-to", REMOTE_PERSONAL_MASTER, "master")
        except sh.ErrorReturnCode as e:
            gitout(e.stderr)
            error("Unable to set tracking for branch 'master'."
                  " Please fix any Git problems and try again.")
            exit(1)
        else:
            info("Master branch set to track personal repo.")
예제 #3
0
def branch_dbedit_exists():
    return BRANCH_DBEDIT in git.branch()
예제 #4
0
def remote_personal_dbedit_exists():
    return REMOTE_PERSONAL_DBEDIT in git.branch("-r")
예제 #5
0
def branch_master_exists():
    return BRANCH_MASTER in git.branch()