OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
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 | 10 # copyright notice, this list of conditions and the following |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 print "> ", | 435 print "> ", |
436 answer = self.ReadLine() | 436 answer = self.ReadLine() |
437 | 437 |
438 # Takes a file containing the patch to apply as first argument. | 438 # Takes a file containing the patch to apply as first argument. |
439 def ApplyPatch(self, patch_file, revert=False): | 439 def ApplyPatch(self, patch_file, revert=False): |
440 try: | 440 try: |
441 self.GitApplyPatch(patch_file, revert) | 441 self.GitApplyPatch(patch_file, revert) |
442 except GitFailedException: | 442 except GitFailedException: |
443 self.WaitForResolvingConflicts(patch_file) | 443 self.WaitForResolvingConflicts(patch_file) |
444 | 444 |
445 def FindLastTrunkPush(self, parent_hash=""): | 445 def FindLastTrunkPush(self, parent_hash="", include_patches=False): |
446 push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based" | 446 push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*" |
| 447 if not include_patches: |
| 448 # Non-patched versions only have three numbers followed by the "(based |
| 449 # on...) comment." |
| 450 push_pattern += " (based" |
447 branch = "" if parent_hash else "svn/trunk" | 451 branch = "" if parent_hash else "svn/trunk" |
448 return self.GitLog(n=1, format="%H", grep=push_pattern, | 452 return self.GitLog(n=1, format="%H", grep=push_pattern, |
449 parent_hash=parent_hash, branch=branch) | 453 parent_hash=parent_hash, branch=branch) |
450 | 454 |
451 | 455 |
452 class UploadStep(Step): | 456 class UploadStep(Step): |
453 MESSAGE = "Upload for code review." | 457 MESSAGE = "Upload for code review." |
454 | 458 |
455 def RunStep(self): | 459 def RunStep(self): |
456 if self._options.reviewer: | 460 if self._options.reviewer: |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 for (number, step_class) in enumerate(step_classes): | 559 for (number, step_class) in enumerate(step_classes): |
556 steps.append(MakeStep(step_class, number, self._state, self._config, | 560 steps.append(MakeStep(step_class, number, self._state, self._config, |
557 options, self._side_effect_handler)) | 561 options, self._side_effect_handler)) |
558 for step in steps[options.step:]: | 562 for step in steps[options.step:]: |
559 if step.Run(): | 563 if step.Run(): |
560 return 1 | 564 return 1 |
561 return 0 | 565 return 0 |
562 | 566 |
563 def Run(self, args=None): | 567 def Run(self, args=None): |
564 return self.RunSteps(self._Steps(), args) | 568 return self.RunSteps(self._Steps(), args) |
OLD | NEW |