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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 print "> ", | 464 print "> ", |
465 answer = self.ReadLine() | 465 answer = self.ReadLine() |
466 | 466 |
467 # Takes a file containing the patch to apply as first argument. | 467 # Takes a file containing the patch to apply as first argument. |
468 def ApplyPatch(self, patch_file, revert=False): | 468 def ApplyPatch(self, patch_file, revert=False): |
469 try: | 469 try: |
470 self.GitApplyPatch(patch_file, revert) | 470 self.GitApplyPatch(patch_file, revert) |
471 except GitFailedException: | 471 except GitFailedException: |
472 self.WaitForResolvingConflicts(patch_file) | 472 self.WaitForResolvingConflicts(patch_file) |
473 | 473 |
474 def FindLastTrunkPush(self, parent_hash="", include_patches=False): | 474 def FindLastTrunkPush( |
| 475 self, parent_hash="", branch="", include_patches=False): |
475 push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*" | 476 push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*" |
476 if not include_patches: | 477 if not include_patches: |
477 # Non-patched versions only have three numbers followed by the "(based | 478 # Non-patched versions only have three numbers followed by the "(based |
478 # on...) comment." | 479 # on...) comment." |
479 push_pattern += " (based" | 480 push_pattern += " (based" |
480 branch = "" if parent_hash else "svn/trunk" | 481 branch = "" if parent_hash else branch or "svn/trunk" |
481 return self.GitLog(n=1, format="%H", grep=push_pattern, | 482 return self.GitLog(n=1, format="%H", grep=push_pattern, |
482 parent_hash=parent_hash, branch=branch) | 483 parent_hash=parent_hash, branch=branch) |
483 | 484 |
484 def ArrayToVersion(self, prefix): | 485 def ArrayToVersion(self, prefix): |
485 return ".".join([self[prefix + "major"], | 486 return ".".join([self[prefix + "major"], |
486 self[prefix + "minor"], | 487 self[prefix + "minor"], |
487 self[prefix + "build"], | 488 self[prefix + "build"], |
488 self[prefix + "patch"]]) | 489 self[prefix + "patch"]]) |
489 | 490 |
490 def SetVersion(self, version_file, prefix): | 491 def SetVersion(self, version_file, prefix): |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 for (number, step_class) in enumerate(step_classes): | 654 for (number, step_class) in enumerate(step_classes): |
654 steps.append(MakeStep(step_class, number, self._state, self._config, | 655 steps.append(MakeStep(step_class, number, self._state, self._config, |
655 options, self._side_effect_handler)) | 656 options, self._side_effect_handler)) |
656 for step in steps[options.step:]: | 657 for step in steps[options.step:]: |
657 if step.Run(): | 658 if step.Run(): |
658 return 1 | 659 return 1 |
659 return 0 | 660 return 0 |
660 | 661 |
661 def Run(self, args=None): | 662 def Run(self, args=None): |
662 return self.RunSteps(self._Steps(), args) | 663 return self.RunSteps(self._Steps(), args) |
OLD | NEW |