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

Side by Side Diff: git_cl.py

Issue 2004303003: git cl upload: die when --no-squash has no commit-msg-hook. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 7 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 (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 and Gerrit.""" 8 """A git-command for integrating reviews on Rietveld and Gerrit."""
9 9
10 from distutils.version import LooseVersion 10 from distutils.version import LooseVersion
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 place. 2516 place.
2517 """ 2517 """
2518 log_desc = options.message or CreateDescriptionFromLog(args) 2518 log_desc = options.message or CreateDescriptionFromLog(args)
2519 git_command = ['commit', '--amend', '-m', log_desc] 2519 git_command = ['commit', '--amend', '-m', log_desc]
2520 RunGit(git_command) 2520 RunGit(git_command)
2521 new_log_desc = CreateDescriptionFromLog(args) 2521 new_log_desc = CreateDescriptionFromLog(args)
2522 if git_footers.get_footer_change_id(new_log_desc): 2522 if git_footers.get_footer_change_id(new_log_desc):
2523 print 'git-cl: Added Change-Id to commit message.' 2523 print 'git-cl: Added Change-Id to commit message.'
2524 return new_log_desc 2524 return new_log_desc
2525 else: 2525 else:
2526 print >> sys.stderr, 'ERROR: Gerrit commit-msg hook not available.' 2526 DieWithError('ERROR: Gerrit commit-msg hook not available.')
Bons 2016/05/24 15:22:36 would it better if instead of saying "available" i
tandrii(chromium) 2016/05/31 15:21:23 agree.
2527 2527
2528 def SetCQState(self, new_state): 2528 def SetCQState(self, new_state):
2529 """Sets the Commit-Queue label assuming canonical CQ config for Gerrit.""" 2529 """Sets the Commit-Queue label assuming canonical CQ config for Gerrit."""
2530 # TODO(tandrii): maybe allow configurability in codereview.settings or by 2530 # TODO(tandrii): maybe allow configurability in codereview.settings or by
2531 # self-discovery of label config for this CL using REST API. 2531 # self-discovery of label config for this CL using REST API.
2532 vote_map = { 2532 vote_map = {
2533 _CQState.NONE: 0, 2533 _CQState.NONE: 0,
2534 _CQState.DRY_RUN: 1, 2534 _CQState.DRY_RUN: 1,
2535 _CQState.COMMIT : 2, 2535 _CQState.COMMIT : 2,
2536 } 2536 }
(...skipping 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after
4901 if __name__ == '__main__': 4901 if __name__ == '__main__':
4902 # These affect sys.stdout so do it outside of main() to simplify mocks in 4902 # These affect sys.stdout so do it outside of main() to simplify mocks in
4903 # unit testing. 4903 # unit testing.
4904 fix_encoding.fix_encoding() 4904 fix_encoding.fix_encoding()
4905 setup_color.init() 4905 setup_color.init()
4906 try: 4906 try:
4907 sys.exit(main(sys.argv[1:])) 4907 sys.exit(main(sys.argv[1:]))
4908 except KeyboardInterrupt: 4908 except KeyboardInterrupt:
4909 sys.stderr.write('interrupted\n') 4909 sys.stderr.write('interrupted\n')
4910 sys.exit(1) 4910 sys.exit(1)
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