def dump(): """Print raw config info.""" print("-----Git Branches-----") git.branch("-vv", _out=gitout) print() print("-----Git Remotes-----") git.remote("-v", "show", _out=gitout)
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.")
def branch_dbedit_exists(): return BRANCH_DBEDIT in git.branch()
def remote_personal_dbedit_exists(): return REMOTE_PERSONAL_DBEDIT in git.branch("-r")
def branch_master_exists(): return BRANCH_MASTER in git.branch()