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

Side by Side Diff: roll_dep.py

Issue 955993006: Handle KeyboardInterrupt consistently in python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: tweek test expectations Created 5 years, 9 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2014 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 """This scripts takes the path to a dep and an svn revision, and updates the 6 """This scripts takes the path to a dep and an svn revision, and updates the
7 parent repo's DEPS file with the corresponding git revision. Sample invocation: 7 parent repo's DEPS file with the corresponding git revision. Sample invocation:
8 8
9 [chromium/src]$ roll-dep third_party/WebKit 12345 9 [chromium/src]$ roll-dep third_party/WebKit 12345
10 10
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 'verification.' % revision) 391 'verification.' % revision)
392 git_rev = revision 392 git_rev = revision
393 comment = None 393 comment = None
394 else: 394 else:
395 (git_rev, svn_rev) = get_git_revision(dep_path, revision) 395 (git_rev, svn_rev) = get_git_revision(dep_path, revision)
396 comment = ('from svn revision %s' % svn_rev) if svn_rev else None 396 comment = ('from svn revision %s' % svn_rev) if svn_rev else None
397 assert git_rev, 'Could not find git revision matching %s.' % revision 397 assert git_rev, 'Could not find git revision matching %s.' % revision
398 return update_deps(deps_file, dep_path, dep_name, git_rev, comment) 398 return update_deps(deps_file, dep_path, dep_name, git_rev, comment)
399 399
400 if __name__ == '__main__': 400 if __name__ == '__main__':
401 sys.exit(main(sys.argv[1:])) 401 try:
402 sys.exit(main(sys.argv[1:]))
403 except KeyboardInterrupt:
404 sys.stderr.write('interrupted\n')
405 sys.exit(1)
OLDNEW
« clang_format.py ('K') | « pylint.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698