| OLD | NEW |
| 1 # Copyright (c) 2010 Google Inc. All rights reserved. | 1 # Copyright (c) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 subprocess_command.append('--verbose') | 828 subprocess_command.append('--verbose') |
| 829 if options.auth_refresh_token_json: | 829 if options.auth_refresh_token_json: |
| 830 subprocess_command.append('--auth-refresh-token-json') | 830 subprocess_command.append('--auth-refresh-token-json') |
| 831 subprocess_command.append(options.auth_refresh_token_json) | 831 subprocess_command.append(options.auth_refresh_token_json) |
| 832 | 832 |
| 833 process = self._tool.executive.popen(subprocess_command, stdout=self._to
ol.executive.PIPE, | 833 process = self._tool.executive.popen(subprocess_command, stdout=self._to
ol.executive.PIPE, |
| 834 stderr=self._tool.executive.STDOUT) | 834 stderr=self._tool.executive.STDOUT) |
| 835 last_output_time = time.time() | 835 last_output_time = time.time() |
| 836 | 836 |
| 837 # git cl sometimes completely hangs. Bail if we haven't gotten any outpu
t to stdout/stderr in a while. | 837 # git cl sometimes completely hangs. Bail if we haven't gotten any outpu
t to stdout/stderr in a while. |
| 838 while process.poll() == None and time.time() < last_output_time + self.S
ECONDS_BEFORE_GIVING_UP: | 838 while process.poll() is None and time.time() < last_output_time + self.S
ECONDS_BEFORE_GIVING_UP: |
| 839 # FIXME: This doesn't make any sense. readline blocks, so all this c
ode to | 839 # FIXME: This doesn't make any sense. readline blocks, so all this c
ode to |
| 840 # try and bail is useless. Instead, we should do the readline calls
on a | 840 # try and bail is useless. Instead, we should do the readline calls
on a |
| 841 # subthread. Then the rest of this code would make sense. | 841 # subthread. Then the rest of this code would make sense. |
| 842 out = process.stdout.readline().rstrip('\n') | 842 out = process.stdout.readline().rstrip('\n') |
| 843 if out: | 843 if out: |
| 844 last_output_time = time.time() | 844 last_output_time = time.time() |
| 845 _log.info(out) | 845 _log.info(out) |
| 846 | 846 |
| 847 if process.poll() == None: | 847 if process.poll() is None: |
| 848 _log.error('Command hung: %s' % subprocess_command) | 848 _log.error('Command hung: %s' % subprocess_command) |
| 849 return False | 849 return False |
| 850 return True | 850 return True |
| 851 | 851 |
| 852 # FIXME: Move this somewhere more general. | 852 # FIXME: Move this somewhere more general. |
| 853 def tree_status(self): | 853 def tree_status(self): |
| 854 blink_tree_status_url = "http://chromium-status.appspot.com/status" | 854 blink_tree_status_url = "http://chromium-status.appspot.com/status" |
| 855 status = urllib2.urlopen(blink_tree_status_url).read().lower() | 855 status = urllib2.urlopen(blink_tree_status_url).read().lower() |
| 856 if 'closed' in status or status == "0": | 856 if 'closed' in status or status == "0": |
| 857 return 'closed' | 857 return 'closed' |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 issue_already_closed = tool.executive.run_command( | 938 issue_already_closed = tool.executive.run_command( |
| 939 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], | 939 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], |
| 940 return_exit_code=True) | 940 return_exit_code=True) |
| 941 if not issue_already_closed: | 941 if not issue_already_closed: |
| 942 self._run_git_cl_command(options, ['set_close']) | 942 self._run_git_cl_command(options, ['set_close']) |
| 943 | 943 |
| 944 tool.scm().ensure_cleanly_tracking_remote_master() | 944 tool.scm().ensure_cleanly_tracking_remote_master() |
| 945 if old_branch_name_or_ref: | 945 if old_branch_name_or_ref: |
| 946 tool.scm().checkout_branch(old_branch_name_or_ref) | 946 tool.scm().checkout_branch(old_branch_name_or_ref) |
| 947 tool.scm().delete_branch(rebaseline_branch_name) | 947 tool.scm().delete_branch(rebaseline_branch_name) |
| OLD | NEW |