Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: sky/tools/deploy_sdk.py

Issue 1088223003: Improve commit message generation for deploy_sdk. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Update per review comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 from datetime import datetime 7 from datetime import datetime
8 import logging 8 import logging
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if args.fake_pub_get_into: 197 if args.fake_pub_get_into:
198 packages_dir = os.path.abspath(args.fake_pub_get_into) 198 packages_dir = os.path.abspath(args.fake_pub_get_into)
199 ensure_dir_exists(packages_dir) 199 ensure_dir_exists(packages_dir)
200 make_relative_symlink(sdk_path('packages/mojo/lib'), 200 make_relative_symlink(sdk_path('packages/mojo/lib'),
201 os.path.join(packages_dir, 'mojo')) 201 os.path.join(packages_dir, 'mojo'))
202 make_relative_symlink(sdk_path('packages/sky/lib'), 202 make_relative_symlink(sdk_path('packages/sky/lib'),
203 os.path.join(packages_dir, 'sky')) 203 os.path.join(packages_dir, 'sky'))
204 204
205 if should_commit: 205 if should_commit:
206 # Kinda a hack to make a prettier build dir for the commit: 206 # Kinda a hack to make a prettier build dir for the commit:
207 rel_build_dir = os.path.join(os.path.split(build_dir)[-2:]) 207 script_path = os.path.relpath(os.path.abspath(__file__), SRC_ROOT)
208 rel_build_dir = os.path.relpath(build_dir, SRC_ROOT)
209 revision = git_revision()
210 commit_url = "https://github.com/domokit/mojo/commit/%s" % revision
211 pattern = """Autogenerated from %s
212 Using %s and build output from %s.
213 """
214 commit_message = pattern % (commit_url, script_path, rel_build_dir)
208 subprocess.check_call(['git', 'add', '.'], cwd=sdk_root) 215 subprocess.check_call(['git', 'add', '.'], cwd=sdk_root)
209 subprocess.check_call([ 216 subprocess.check_call([
210 'git', 'commit', 217 'git', 'commit',
211 '-m', '%s from %s' % (rel_build_dir, git_revision()) 218 '-m', commit_message
212 ], cwd=sdk_root) 219 ], cwd=sdk_root)
213 220
214 time_delta = datetime.now() - start_time 221 time_delta = datetime.now() - start_time
215 print 'SDK built at %s in %ss' % (sdk_root, time_delta.total_seconds()) 222 print 'SDK built at %s in %ss' % (sdk_root, time_delta.total_seconds())
216 223
217 224
218 if __name__ == '__main__': 225 if __name__ == '__main__':
219 main() 226 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698