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

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: installed Created 4 years, 6 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 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 place. 2521 place.
2522 """ 2522 """
2523 log_desc = options.message or CreateDescriptionFromLog(args) 2523 log_desc = options.message or CreateDescriptionFromLog(args)
2524 git_command = ['commit', '--amend', '-m', log_desc] 2524 git_command = ['commit', '--amend', '-m', log_desc]
2525 RunGit(git_command) 2525 RunGit(git_command)
2526 new_log_desc = CreateDescriptionFromLog(args) 2526 new_log_desc = CreateDescriptionFromLog(args)
2527 if git_footers.get_footer_change_id(new_log_desc): 2527 if git_footers.get_footer_change_id(new_log_desc):
2528 print 'git-cl: Added Change-Id to commit message.' 2528 print 'git-cl: Added Change-Id to commit message.'
2529 return new_log_desc 2529 return new_log_desc
2530 else: 2530 else:
2531 print >> sys.stderr, 'ERROR: Gerrit commit-msg hook not available.' 2531 DieWithError('ERROR: Gerrit commit-msg hook not installed.')
2532 2532
2533 def SetCQState(self, new_state): 2533 def SetCQState(self, new_state):
2534 """Sets the Commit-Queue label assuming canonical CQ config for Gerrit.""" 2534 """Sets the Commit-Queue label assuming canonical CQ config for Gerrit."""
2535 # TODO(tandrii): maybe allow configurability in codereview.settings or by 2535 # TODO(tandrii): maybe allow configurability in codereview.settings or by
2536 # self-discovery of label config for this CL using REST API. 2536 # self-discovery of label config for this CL using REST API.
2537 vote_map = { 2537 vote_map = {
2538 _CQState.NONE: 0, 2538 _CQState.NONE: 0,
2539 _CQState.DRY_RUN: 1, 2539 _CQState.DRY_RUN: 1,
2540 _CQState.COMMIT : 2, 2540 _CQState.COMMIT : 2,
2541 } 2541 }
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
4887 if __name__ == '__main__': 4887 if __name__ == '__main__':
4888 # These affect sys.stdout so do it outside of main() to simplify mocks in 4888 # These affect sys.stdout so do it outside of main() to simplify mocks in
4889 # unit testing. 4889 # unit testing.
4890 fix_encoding.fix_encoding() 4890 fix_encoding.fix_encoding()
4891 setup_color.init() 4891 setup_color.init()
4892 try: 4892 try:
4893 sys.exit(main(sys.argv[1:])) 4893 sys.exit(main(sys.argv[1:]))
4894 except KeyboardInterrupt: 4894 except KeyboardInterrupt:
4895 sys.stderr.write('interrupted\n') 4895 sys.stderr.write('interrupted\n')
4896 sys.exit(1) 4896 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