| OLD | NEW |
| 1 # Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. | 1 # Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. |
| 2 # Copyright (c) 2009 Apple Inc. All rights reserved. | 2 # Copyright (c) 2009 Apple Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 int(match.group(4)), int(match.gr
oup(5)), int(match.group(6)), 0) | 224 int(match.group(4)), int(match.gr
oup(5)), int(match.group(6)), 0) |
| 225 | 225 |
| 226 sign = 1 if match.group(7) == '+' else -1 | 226 sign = 1 if match.group(7) == '+' else -1 |
| 227 time_without_timezone = time_with_timezone - \ | 227 time_without_timezone = time_with_timezone - \ |
| 228 datetime.timedelta(hours=sign * int(match.group(8)), minutes=int(mat
ch.group(9))) | 228 datetime.timedelta(hours=sign * int(match.group(8)), minutes=int(mat
ch.group(9))) |
| 229 return time_without_timezone.strftime('%Y-%m-%dT%H:%M:%SZ') | 229 return time_without_timezone.strftime('%Y-%m-%dT%H:%M:%SZ') |
| 230 | 230 |
| 231 def create_patch(self, git_commit=None, changed_files=None): | 231 def create_patch(self, git_commit=None, changed_files=None): |
| 232 """Returns a byte array (str()) representing the patch file. | 232 """Returns a byte array (str()) representing the patch file. |
| 233 Patch files are effectively binary since they may contain | 233 Patch files are effectively binary since they may contain |
| 234 files of multiple different encodings.""" | 234 files of multiple different encodings. |
| 235 """ |
| 235 | 236 |
| 236 # Put code changes at the top of the patch and layout tests | 237 # Put code changes at the top of the patch and layout tests |
| 237 # at the bottom, this makes for easier reviewing. | 238 # at the bottom, this makes for easier reviewing. |
| 238 config_path = self._filesystem.dirname(self._filesystem.path_to_module('
webkitpy.common.config')) | 239 config_path = self._filesystem.dirname(self._filesystem.path_to_module('
webkitpy.common.config')) |
| 239 order_file = self._filesystem.join(config_path, 'orderfile') | 240 order_file = self._filesystem.join(config_path, 'orderfile') |
| 240 order = "" | 241 order = "" |
| 241 if self._filesystem.exists(order_file): | 242 if self._filesystem.exists(order_file): |
| 242 order = "-O%s" % order_file | 243 order = "-O%s" % order_file |
| 243 | 244 |
| 244 command = [self.executable_name, 'diff', '--binary', '--no-color', "--no
-ext-diff", | 245 command = [self.executable_name, 'diff', '--binary', '--no-color', "--no
-ext-diff", |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 if self.current_branch() != self._branch_tracking_remote_master(): | 321 if self.current_branch() != self._branch_tracking_remote_master(): |
| 321 return False | 322 return False |
| 322 if len(self._local_commits(self._branch_tracking_remote_master())) > 0: | 323 if len(self._local_commits(self._branch_tracking_remote_master())) > 0: |
| 323 return False | 324 return False |
| 324 return True | 325 return True |
| 325 | 326 |
| 326 def ensure_cleanly_tracking_remote_master(self): | 327 def ensure_cleanly_tracking_remote_master(self): |
| 327 self._discard_working_directory_changes() | 328 self._discard_working_directory_changes() |
| 328 self._run_git(['checkout', '-q', self._branch_tracking_remote_master()]) | 329 self._run_git(['checkout', '-q', self._branch_tracking_remote_master()]) |
| 329 self._discard_local_commits() | 330 self._discard_local_commits() |
| OLD | NEW |