diff options
author | David James <davidjames@chromium.org> | 2013-04-19 09:41:29 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-19 11:44:07 -0700 |
commit | 29e86d5ae02fe224ba6e230188a1fd776436a72e (patch) | |
tree | e3aea2d124e8c753c15b898573fcd37ce4f6539a /scripts/cros_mark_as_stable.py | |
parent | 773173c9c8a322f3e98ab2f7c1c2ad1deecf675f (diff) | |
download | chromite-29e86d5ae02fe224ba6e230188a1fd776436a72e.tar.gz |
cros_mark_as_stable: Commit changes as one big batch instead of individually.
This speeds up the uprev stage by about 15 seconds (from 2m9s to 1m53s).
BUG=chromium:232960
TEST=trybot
Change-Id: If40f938956429db769ce439868400de7e893004b
Reviewed-on: https://gerrit.chromium.org/gerrit/48432
Commit-Queue: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Diffstat (limited to 'scripts/cros_mark_as_stable.py')
-rw-r--r-- | scripts/cros_mark_as_stable.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/cros_mark_as_stable.py b/scripts/cros_mark_as_stable.py index 78c9388c4..c67419b1a 100644 --- a/scripts/cros_mark_as_stable.py +++ b/scripts/cros_mark_as_stable.py @@ -18,6 +18,9 @@ from chromite.lib import osutils from chromite.lib import parallel +# Commit message for uprevving Portage packages. +_GIT_COMMIT_MESSAGE = 'Marking 9999 ebuild for %s as stable.' + # Dictionary of valid commands with usage information. COMMAND_DICTIONARY = { 'commit': @@ -295,6 +298,7 @@ def main(_argv): cros_build_lib.RunCommand(['git', 'rebase', existing_branch], print_cmd=False, cwd=overlay) + messages = [] for ebuild in ebuilds: if options.verbose: cros_build_lib.Info('Working on %s', ebuild.package) @@ -303,12 +307,16 @@ def main(_argv): if new_package: revved_packages.append(ebuild.package) new_package_atoms.append('=%s' % new_package) + messages.append(_GIT_COMMIT_MESSAGE % ebuild.package) except (OSError, IOError): cros_build_lib.Warning('Cannot rev %s\n' % ebuild.package + 'Note you will have to go into %s ' 'and reset the git repo yourself.' % overlay) raise + if messages: + portage_utilities.EBuild.CommitChange('\n\n'.join(messages), overlay) + if cros_build_lib.IsInsideChroot(): # Regenerate caches if need be. We do this all the time to # catch when users make changes without updating cache files. |