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

Side by Side Diff: git_cl.py

Issue 1692513002: Gerrit git cl: run same post-upload hooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 10 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 | tests/git_cl_test.py » ('j') | 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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 from distutils.version import LooseVersion 10 from distutils.version import LooseVersion
(...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 ask_for_data('About to upload; enter to confirm.') 2467 ask_for_data('About to upload; enter to confirm.')
2468 2468
2469 print_stats(options.similarity, options.find_copies, args) 2469 print_stats(options.similarity, options.find_copies, args)
2470 if settings.GetIsGerrit(): 2470 if settings.GetIsGerrit():
2471 if options.squash and options.no_squash: 2471 if options.squash and options.no_squash:
2472 DieWithError('Can only use one of --squash or --no-squash') 2472 DieWithError('Can only use one of --squash or --no-squash')
2473 2473
2474 options.squash = ((settings.GetSquashGerritUploads() or options.squash) and 2474 options.squash = ((settings.GetSquashGerritUploads() or options.squash) and
2475 not options.no_squash) 2475 not options.no_squash)
2476 2476
2477 return GerritUpload(options, args, cl, change) 2477 ret = GerritUpload(options, args, cl, change)
2478 ret = RietveldUpload(options, args, cl, change) 2478 else:
2479 ret = RietveldUpload(options, args, cl, change)
2479 if not ret: 2480 if not ret:
2480 git_set_branch_value('last-upload-hash', 2481 git_set_branch_value('last-upload-hash',
2481 RunGit(['rev-parse', 'HEAD']).strip()) 2482 RunGit(['rev-parse', 'HEAD']).strip())
2482 # Run post upload hooks, if specified. 2483 # Run post upload hooks, if specified.
2483 if settings.GetRunPostUploadHook(): 2484 if settings.GetRunPostUploadHook():
2484 presubmit_support.DoPostUploadExecuter( 2485 presubmit_support.DoPostUploadExecuter(
2485 change, 2486 change,
2486 cl, 2487 cl,
2487 settings.GetRoot(), 2488 settings.GetRoot(),
2488 options.verbose, 2489 options.verbose,
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
3759 if __name__ == '__main__': 3760 if __name__ == '__main__':
3760 # These affect sys.stdout so do it outside of main() to simplify mocks in 3761 # These affect sys.stdout so do it outside of main() to simplify mocks in
3761 # unit testing. 3762 # unit testing.
3762 fix_encoding.fix_encoding() 3763 fix_encoding.fix_encoding()
3763 colorama.init() 3764 colorama.init()
3764 try: 3765 try:
3765 sys.exit(main(sys.argv[1:])) 3766 sys.exit(main(sys.argv[1:]))
3766 except KeyboardInterrupt: 3767 except KeyboardInterrupt:
3767 sys.stderr.write('interrupted\n') 3768 sys.stderr.write('interrupted\n')
3768 sys.exit(1) 3769 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698