From 70311cdfdd9acdbb885f442c1fcc17935f81d4c6 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Wed, 29 Dec 2010 15:23:15 -0800 Subject: [PATCH] Change logic to auto-rev for latest_release and sticky branch. Also some cleanup and fixing so we don't create unnecessary ebuilds. I noticed that both the latest release and stable release code were trying to rev the same branch whenever we moved to a new stable version. It was harmless before but now that we're pushing this as stable we want exactly to have the minimum number of revs that are correct Change-Id: I9f834d35be8e85c27ab0505ec81637f9a3c27b88 BUG= TEST=Unittests and mocked in my own directory by creating new stable branch. Review URL: http://codereview.chromium.org/6025012 --- bin/cros_mark_chrome_as_stable.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/cros_mark_chrome_as_stable.py b/bin/cros_mark_chrome_as_stable.py index d7a75605e6..dc006a7b92 100755 --- a/bin/cros_mark_chrome_as_stable.py +++ b/bin/cros_mark_chrome_as_stable.py @@ -264,9 +264,12 @@ def MarkChromeEBuildAsStable(stable_candidate, unstable_ebuild, chrome_rev, new_ebuild_path = base_path + ('%s-r1.ebuild' % portage_suffix) + # Mark latest release and sticky branches as stable. + mark_stable = chrome_rev != TIP_OF_TRUNK + cros_mark_as_stable.EBuildStableMarker.MarkAsStable( unstable_ebuild.ebuild_path, new_ebuild_path, 'CROS_SVN_COMMIT', commit, - make_stable=False) + make_stable=mark_stable) new_ebuild = ChromeEBuild(new_ebuild_path) if stable_candidate and ( stable_candidate.chrome_version == new_ebuild.chrome_version): @@ -321,12 +324,21 @@ def main(): commit_to_use = _GetTipOfTrunkSvnRevision() elif chrome_rev == LATEST_RELEASE: version_to_uprev = _GetLatestRelease() + # Don't rev on stable branch for latest_release. + if re.match('%s\.\d+' % sticky_branch, version_to_uprev): + Info('Latest release is sticky branch. Nothing to do.') + return else: version_to_uprev = _GetLatestRelease(sticky_branch) stable_candidate = FindChromeUprevCandidate(stable_ebuilds, chrome_rev, sticky_branch) + if stable_candidate: + Info('Stable candidate found %s' % stable_candidate) + else: + Info('No stable candidate found.') + os.chdir(overlay_dir) work_branch = cros_mark_as_stable.GitBranch( cros_mark_as_stable.STABLE_BRANCH_NAME, options.tracking_branch)