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
This commit is contained in:
Chris Sosa 2010-12-29 15:23:15 -08:00
parent 607c0780c0
commit 70311cdfdd

View File

@ -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)