diff options
author | Prathmesh Prabhu <pprabhu@chromium.org> | 2015-05-07 16:52:10 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-11 19:42:01 +0000 |
commit | e5f4d47a16b5f8173f89ea98c84a0ace4b5fb709 (patch) | |
tree | 719eb7a08a01214225012af24b9e23944dea67f2 /cbuildbot/stages/branch_stages.py | |
parent | 59cd05940789337747f2186fae780813f3bc7802 (diff) | |
download | chromite-e5f4d47a16b5f8173f89ea98c84a0ace4b5fb709.tar.gz |
branch_util: Add a argument to branch-util to skip remote push.
This CL adds an argument to the branch-util subgroup of cbuildbot to
skip pushing to remote repositories completely. This will be used by an
integration test that uses branch_util end-to-end, skipping just the
push-to-remote part.
BUG=chromium:470690
TEST=`cbuildbot --local branch-util --skip-remote-push \
--branch-name blah --version 7041.0.0`
Change-Id: I73cb1afdcc1daa9ac7ced916f9b5876e7ba7e06a
Reviewed-on: https://chromium-review.googlesource.com/270043
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Diffstat (limited to 'cbuildbot/stages/branch_stages.py')
-rw-r--r-- | cbuildbot/stages/branch_stages.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cbuildbot/stages/branch_stages.py b/cbuildbot/stages/branch_stages.py index 12e2f9f66..a9b9dafc4 100644 --- a/cbuildbot/stages/branch_stages.py +++ b/cbuildbot/stages/branch_stages.py @@ -47,6 +47,7 @@ class BranchUtilStage(generic_stages.BuilderStage): def __init__(self, builder_run, **kwargs): super(BranchUtilStage, self).__init__(builder_run, **kwargs) + self.skip_remote_push = self._run.options.skip_remote_push self.dryrun = self._run.options.debug_forced self.branch_name = self._run.options.branch_name self.rename_to = self._run.options.rename_to @@ -65,7 +66,8 @@ class BranchUtilStage(generic_stages.BuilderStage): # If dest_ref is already refs/heads/<branch> it's a noop. dest_ref = git.NormalizeRef(git.StripRefs(dest_ref)) push_to = git.RemoteRef(checkout['push_remote'], dest_ref) - git.GitPush(checkout['local_path'], src_ref, push_to, dryrun=self.dryrun, + dryrun = self.dryrun or self.skip_remote_push + git.GitPush(checkout['local_path'], src_ref, push_to, dryrun=dryrun, force=force) def _FetchAndCheckoutTo(self, checkout_dir, remote_ref): @@ -341,8 +343,9 @@ class BranchUtilStage(generic_stages.BuilderStage): message = 'Fix up manifest after branching %s.' % branch_ref git.RunGit(manifest_dir, ['commit', '-m', message], print_cmd=True) push_to = git.RemoteRef(push_remote, branch_ref) + dryrun = self.dryrun or self.skip_remote_push git.GitPush(manifest_dir, manifest_version.PUSH_BRANCH, push_to, - dryrun=self.dryrun, force=self.dryrun) + dryrun=dryrun, force=dryrun) def _IncrementVersionOnDisk(self, incr_type, push_to, message): """Bumps the version found in chromeos_version.sh on a branch. |