OLD | NEW |
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 __future__ import print_function | 10 from __future__ import print_function |
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 return 1 | 2299 return 1 |
2300 detail = self._GetChangeDetail(['CURRENT_REVISION', 'LABELS']) | 2300 detail = self._GetChangeDetail(['CURRENT_REVISION', 'LABELS']) |
2301 if u'Commit-Queue' in detail.get('labels', {}): | 2301 if u'Commit-Queue' in detail.get('labels', {}): |
2302 if not force: | 2302 if not force: |
2303 ask_for_data('\nIt seems this repository has a Commit Queue, ' | 2303 ask_for_data('\nIt seems this repository has a Commit Queue, ' |
2304 'which can test and land changes for you. ' | 2304 'which can test and land changes for you. ' |
2305 'Are you sure you wish to bypass it?\n' | 2305 'Are you sure you wish to bypass it?\n' |
2306 'Press Enter to continue, Ctrl+C to abort.') | 2306 'Press Enter to continue, Ctrl+C to abort.') |
2307 | 2307 |
2308 differs = True | 2308 differs = True |
2309 last_upload = RunGit(['config', self._GitBranchSetting('gerritsquashhash')], | 2309 last_upload = self._GitGetBranchConfigValue('gerritsquashhash') |
2310 error_ok=True).strip() | |
2311 # Note: git diff outputs nothing if there is no diff. | 2310 # Note: git diff outputs nothing if there is no diff. |
2312 if not last_upload or RunGit(['diff', last_upload]).strip(): | 2311 if not last_upload or RunGit(['diff', last_upload]).strip(): |
2313 print('WARNING: some changes from local branch haven\'t been uploaded') | 2312 print('WARNING: some changes from local branch haven\'t been uploaded') |
2314 else: | 2313 else: |
2315 if detail['current_revision'] == last_upload: | 2314 if detail['current_revision'] == last_upload: |
2316 differs = False | 2315 differs = False |
2317 else: | 2316 else: |
2318 print('WARNING: local branch contents differ from latest uploaded ' | 2317 print('WARNING: local branch contents differ from latest uploaded ' |
2319 'patchset') | 2318 'patchset') |
2320 if differs: | 2319 if differs: |
(...skipping 2896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 if __name__ == '__main__': | 5216 if __name__ == '__main__': |
5218 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5217 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5219 # unit testing. | 5218 # unit testing. |
5220 fix_encoding.fix_encoding() | 5219 fix_encoding.fix_encoding() |
5221 setup_color.init() | 5220 setup_color.init() |
5222 try: | 5221 try: |
5223 sys.exit(main(sys.argv[1:])) | 5222 sys.exit(main(sys.argv[1:])) |
5224 except KeyboardInterrupt: | 5223 except KeyboardInterrupt: |
5225 sys.stderr.write('interrupted\n') | 5224 sys.stderr.write('interrupted\n') |
5226 sys.exit(1) | 5225 sys.exit(1) |
OLD | NEW |