Chromium Code Reviews| 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 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2234 def _GetChangeDetail(self, options=None, issue=None): | 2234 def _GetChangeDetail(self, options=None, issue=None): |
| 2235 options = options or [] | 2235 options = options or [] |
| 2236 issue = issue or self.GetIssue() | 2236 issue = issue or self.GetIssue() |
| 2237 assert issue, 'issue required to query Gerrit' | 2237 assert issue, 'issue required to query Gerrit' |
| 2238 return gerrit_util.GetChangeDetail(self._GetGerritHost(), str(issue), | 2238 return gerrit_util.GetChangeDetail(self._GetGerritHost(), str(issue), |
| 2239 options) | 2239 options) |
| 2240 | 2240 |
| 2241 def CMDLand(self, force, bypass_hooks, verbose): | 2241 def CMDLand(self, force, bypass_hooks, verbose): |
| 2242 if git_common.is_dirty_git_tree('land'): | 2242 if git_common.is_dirty_git_tree('land'): |
| 2243 return 1 | 2243 return 1 |
| 2244 detail = self._GetChangeDetail(['CURRENT_REVISION', 'LABELS']) | |
| 2245 if u'Commit-Queue' in detail.get('labels', {}): | |
| 2246 if not force: | |
| 2247 ask_for_data('\nIt seems this repository has a Commit Queue, ' | |
|
agable
2016/06/21 16:43:54
"This repository has..."
No need to be wishy-wash
tandrii(chromium)
2016/06/21 17:33:29
ChromeOS folks defined Commit-Queue label in All P
tandrii(chromium)
2016/07/25 09:39:32
and you did the cleanup, and this it still is "see
| |
| 2248 'which can test and land changes for you. \n' | |
|
agable
2016/06/21 16:43:54
"...land changes for you. Are you sure you wish to
tandrii(chromium)
2016/06/21 17:33:29
Done.
| |
| 2249 'Press Enter to continue, Ctrl+C to abort.') | |
| 2250 | |
| 2244 differs = True | 2251 differs = True |
| 2245 last_upload = RunGit(['config', | 2252 last_upload = RunGit(['config', |
| 2246 'branch.%s.gerritsquashhash' % self.GetBranch()], | 2253 'branch.%s.gerritsquashhash' % self.GetBranch()], |
| 2247 error_ok=True).strip() | 2254 error_ok=True).strip() |
| 2248 # Note: git diff outputs nothing if there is no diff. | 2255 # Note: git diff outputs nothing if there is no diff. |
| 2249 if not last_upload or RunGit(['diff', last_upload]).strip(): | 2256 if not last_upload or RunGit(['diff', last_upload]).strip(): |
| 2250 print('WARNING: some changes from local branch haven\'t been uploaded') | 2257 print('WARNING: some changes from local branch haven\'t been uploaded') |
| 2251 else: | 2258 else: |
| 2252 detail = self._GetChangeDetail(['CURRENT_REVISION']) | |
| 2253 if detail['current_revision'] == last_upload: | 2259 if detail['current_revision'] == last_upload: |
| 2254 differs = False | 2260 differs = False |
| 2255 else: | 2261 else: |
| 2256 print('WARNING: local branch contents differ from latest uploaded ' | 2262 print('WARNING: local branch contents differ from latest uploaded ' |
| 2257 'patchset') | 2263 'patchset') |
| 2258 if differs: | 2264 if differs: |
| 2259 if not force: | 2265 if not force: |
| 2260 ask_for_data( | 2266 ask_for_data( |
| 2261 'Do you want to submit latest Gerrit patchset and bypass hooks?') | 2267 'Do you want to submit latest Gerrit patchset and bypass hooks?') |
| 2262 print('WARNING: bypassing hooks and submitting latest uploaded patchset') | 2268 print('WARNING: bypassing hooks and submitting latest uploaded patchset') |
| (...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5042 if __name__ == '__main__': | 5048 if __name__ == '__main__': |
| 5043 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5049 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 5044 # unit testing. | 5050 # unit testing. |
| 5045 fix_encoding.fix_encoding() | 5051 fix_encoding.fix_encoding() |
| 5046 setup_color.init() | 5052 setup_color.init() |
| 5047 try: | 5053 try: |
| 5048 sys.exit(main(sys.argv[1:])) | 5054 sys.exit(main(sys.argv[1:])) |
| 5049 except KeyboardInterrupt: | 5055 except KeyboardInterrupt: |
| 5050 sys.stderr.write('interrupted\n') | 5056 sys.stderr.write('interrupted\n') |
| 5051 sys.exit(1) | 5057 sys.exit(1) |
| OLD | NEW |