From d2b72f7c2f8979275fa38944c34852fab76c722e Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 26 Oct 2010 12:35:37 -0700 Subject: [PATCH] Correctly initialize tracking branch in preflight rinse. Currently cros/master is used for the tracking branch in the preflight rinse step. This is wrong if --tracking_branch is specified differently in the command-line options to cbuildbot.py. BUG=none TEST=Ran unit tests Change-Id: Id4fb989863ae11f57889faf6a8d8b043b81da58e Review URL: http://codereview.chromium.org/4104005 --- bin/cbuildbot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index d58a72727b..6708c045b4 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -224,13 +224,13 @@ def _GetVMConstants(buildroot): return (vdisk_size.strip(), statefulfs_size.strip()) -def _GitCleanup(buildroot, board): +def _GitCleanup(buildroot, board, tracking_branch): """Clean up git branch after previous uprev attempt.""" cwd = os.path.join(buildroot, 'src', 'scripts') if os.path.exists(cwd): RunCommand(['./cros_mark_as_stable', '--srcroot=..', '--board=%s' % board, - '--tracking_branch="cros/master"', 'clean'], + '--tracking_branch="%s"' % tracking_branch, 'clean'], cwd=cwd, error_ok=True) @@ -253,9 +253,9 @@ def _WipeOldOutput(buildroot): # =========================== Main Commands =================================== -def _PreFlightRinse(buildroot, board): +def _PreFlightRinse(buildroot, board, tracking_branch): """Cleans up any leftover state from previous runs.""" - _GitCleanup(buildroot, board) + _GitCleanup(buildroot, board, tracking_branch) _CleanUpMountPoints(buildroot) RunCommand(['sudo', 'killall', 'kvm'], error_ok=True) @@ -490,7 +490,7 @@ def main(): sys.exit(1) try: - _PreFlightRinse(buildroot, buildconfig['board']) + _PreFlightRinse(buildroot, buildconfig['board'], tracking_branch) if options.clobber or not os.path.isdir(buildroot): _FullCheckout(buildroot, tracking_branch, url=options.url) else: