summaryrefslogtreecommitdiff
path: root/cbuildbot/stages/branch_stages.py
diff options
context:
space:
mode:
authorPrathmesh Prabhu <pprabhu@chromium.org>2015-06-10 12:08:29 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-16 05:15:28 +0000
commit07f504271ecbdce183bc93bc170b0ba724e63771 (patch)
tree4411e457839cf185ab908305c5d002a5966e94d0 /cbuildbot/stages/branch_stages.py
parentecd8e683f2ab6ffcc92a634d507bdad214e5587c (diff)
downloadchromite-07f504271ecbdce183bc93bc170b0ba724e63771.tar.gz
branch-util: Fix skip-remote-push option.
- Don't push to remote in git.GitPush with the 'skip' option set. Before this CL, we used git's --dry-run option, but that fails when users without permission to push to remote try to run with --debug. - CL:270043, that added the option, missed one place where we push to remote. - While there, fix a misleading docstring. BUG=chromium:470690 TEST=(1) unittests (2) `cbuildbot --local branch-util --skip-remote-push --branch-name blah --version XXXX.X.x` Change-Id: I776632cf62ecfaaadcc1d12048ce4e91540bd1a9 Reviewed-on: https://chromium-review.googlesource.com/276625 Reviewed-by: Don Garrett <dgarrett@chromium.org> Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org> Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Diffstat (limited to 'cbuildbot/stages/branch_stages.py')
-rw-r--r--cbuildbot/stages/branch_stages.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/cbuildbot/stages/branch_stages.py b/cbuildbot/stages/branch_stages.py
index a9b9dafc4..deee8bda5 100644
--- a/cbuildbot/stages/branch_stages.py
+++ b/cbuildbot/stages/branch_stages.py
@@ -47,8 +47,8 @@ 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.skip_remote_push = (self._run.options.skip_remote_push or
+ self._run.options.debug_forced)
self.branch_name = self._run.options.branch_name
self.rename_to = self._run.options.rename_to
@@ -66,9 +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)
- dryrun = self.dryrun or self.skip_remote_push
- git.GitPush(checkout['local_path'], src_ref, push_to, dryrun=dryrun,
- force=force)
+ git.GitPush(checkout['local_path'], src_ref, push_to, force=force,
+ skip=self.skip_remote_push)
def _FetchAndCheckoutTo(self, checkout_dir, remote_ref):
"""Fetch a remote ref and check out to it.
@@ -343,9 +342,8 @@ 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=dryrun, force=dryrun)
+ skip=self.skip_remote_push)
def _IncrementVersionOnDisk(self, incr_type, push_to, message):
"""Bumps the version found in chromeos_version.sh on a branch.
@@ -358,7 +356,8 @@ class BranchUtilStage(generic_stages.BuilderStage):
version_info = manifest_version.VersionInfo.from_repo(
self._build_root, incr_type=incr_type)
version_info.IncrementVersion()
- version_info.UpdateVersionFile(message, dry_run=self.dryrun,
+ version_info.UpdateVersionFile(message,
+ dry_run=self.skip_remote_push,
push_to=push_to)
@staticmethod
@@ -398,8 +397,9 @@ class BranchUtilStage(generic_stages.BuilderStage):
# This needs to happen before the source branch version bumping above
# because we rely on the fact that since our current overlay checkout
# is what we just pushed to the new branch, we don't need to do another
- # sync. This also makes it easier to implement dryrun functionality (the
- # new branch doesn't actually get created in dryrun mode).
+ # sync. This also makes it easier to implement skip_remote_push
+ # functionality (the new branch doesn't actually get created in
+ # skip_remote_push mode).
# Use local branch ref.
branch_ref = git.NormalizeRef(self.branch_name)