| 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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 # FIXME: This should probably batch up lines if they're available an
d log to the server once. | 918 # FIXME: This should probably batch up lines if they're available an
d log to the server once. |
| 919 out = self._log_line(process.stdout) | 919 out = self._log_line(process.stdout) |
| 920 | 920 |
| 921 def _do_one_rebaseline(self): | 921 def _do_one_rebaseline(self): |
| 922 self._log_queue = Queue.Queue(256) | 922 self._log_queue = Queue.Queue(256) |
| 923 log_thread = threading.Thread(name='LogToServer', target=self._log_to_se
rver_thread) | 923 log_thread = threading.Thread(name='LogToServer', target=self._log_to_se
rver_thread) |
| 924 log_thread.start() | 924 log_thread.start() |
| 925 try: | 925 try: |
| 926 old_branch_name = self._tool.scm().current_branch() | 926 old_branch_name = self._tool.scm().current_branch() |
| 927 self._run_logged_command(['git', 'pull']) | 927 self._run_logged_command(['git', 'pull']) |
| 928 rebaseline_command = [self._tool.filesystem.join(self._tool.scm().ch
eckout_root, 'Tools', 'Scripts', 'webkit-patch'), 'auto-rebaseline'] | 928 rebaseline_command = [self._tool.filesystem.join(self._tool.scm().ch
eckout_root, 'tools', 'webkit-patch'), 'auto-rebaseline'] |
| 929 if self._verbose: | 929 if self._verbose: |
| 930 rebaseline_command.append('--verbose') | 930 rebaseline_command.append('--verbose') |
| 931 self._run_logged_command(rebaseline_command) | 931 self._run_logged_command(rebaseline_command) |
| 932 except: | 932 except: |
| 933 self._log_queue.put(self.QUIT_LOG) | 933 self._log_queue.put(self.QUIT_LOG) |
| 934 traceback.print_exc(file=sys.stderr) | 934 traceback.print_exc(file=sys.stderr) |
| 935 # Sometimes git crashes and leaves us on a detached head. | 935 # Sometimes git crashes and leaves us on a detached head. |
| 936 self._tool.scm().checkout_branch(old_branch_name) | 936 self._tool.scm().checkout_branch(old_branch_name) |
| 937 else: | 937 else: |
| 938 self._log_queue.put(self.QUIT_LOG) | 938 self._log_queue.put(self.QUIT_LOG) |
| 939 log_thread.join() | 939 log_thread.join() |
| 940 | 940 |
| 941 def execute(self, options, args, tool): | 941 def execute(self, options, args, tool): |
| 942 self._verbose = options.verbose | 942 self._verbose = options.verbose |
| 943 while True: | 943 while True: |
| 944 self._do_one_rebaseline() | 944 self._do_one_rebaseline() |
| 945 time.sleep(self.SLEEP_TIME_IN_SECONDS) | 945 time.sleep(self.SLEEP_TIME_IN_SECONDS) |
| OLD | NEW |