def update_milestone(m): '''Update SkMilestone.h to match the given milestone number.''' with git_utils.NewGitCheckout(SKIA_REPO, local=_REPO_ROOT): with git_utils.GitBranch( 'update_milestone', UPDATE_MILESTONE_COMMIT_MSG % m): with open(SK_MILESTONE_H, 'r+') as f: contents = re.sub( SK_MILESTONE_RE, SK_MILESTONE_TMPL % str(m), f.read(), flags=re.M) f.seek(0) f.write(contents) f.truncate() git.git('diff')
def create_new_branch(new_branch, branch_at): '''Create a temporary checkout of the repo, create the new branch and push.''' b = new_branch[len(REFS_HEADS_PREFIX):] with git_utils.NewGitCheckout(SKIA_REPO, local=_REPO_ROOT): git.git('checkout', '-b', b) git.git('reset', '--hard', branch_at) git.git('push', '--set-upstream', 'origin', b)
def update_infra_config(old_branch, new_branch): '''Create a CL to add infra support for the new branch and remove the old.''' owner = git.git('config', 'user.email').rstrip() if not owner: print >> sys.stderr, ('No configured git user; please run ' '"git config user.email <your email>".') sys.exit(1) go.get(go.INFRA_GO + '/go/supported_branches/cmd/new-branch') subprocess.check_call([ 'new-branch', '--branch', new_branch, '--delete', old_branch, '--owner', owner, '--exclude-trybots=chromium.*', '--exclude-trybots=.*Android_Framework.*' ])
def update_infra_config(old_branch, new_branch): '''Create a CL to add infra support for the new branch and remove the old.''' owner = git.git('config', 'user.email').rstrip() if not owner: print >> sys.stderr, ('No configured git user; please run ' '"git config user.email <your email>".') sys.exit(1) go.get(go.INFRA_GO+'/go/supported_branches/cmd/new-branch') subprocess.check_call(['new-branch', '--branch', new_branch, '--delete', old_branch, '--owner', owner, '--exclude-trybots=chromium.*', '--exclude-trybots=.*Android_Framework.*'])