| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 branch = "" if parent_hash else branch or self.vc.RemoteCandidateBranch() | 599 branch = "" if parent_hash else branch or self.vc.RemoteCandidateBranch() |
| 600 return self.GitLog(n=1, format="%H", grep=push_pattern, | 600 return self.GitLog(n=1, format="%H", grep=push_pattern, |
| 601 parent_hash=parent_hash, branch=branch) | 601 parent_hash=parent_hash, branch=branch) |
| 602 | 602 |
| 603 def ArrayToVersion(self, prefix): | 603 def ArrayToVersion(self, prefix): |
| 604 return ".".join([self[prefix + "major"], | 604 return ".".join([self[prefix + "major"], |
| 605 self[prefix + "minor"], | 605 self[prefix + "minor"], |
| 606 self[prefix + "build"], | 606 self[prefix + "build"], |
| 607 self[prefix + "patch"]]) | 607 self[prefix + "patch"]]) |
| 608 | 608 |
| 609 def StoreVersion(self, version, prefix): |
| 610 version_parts = version.split(".") |
| 611 if len(version_parts) == 3: |
| 612 version_parts.append("0") |
| 613 major, minor, build, patch = version_parts |
| 614 self[prefix + "major"] = major |
| 615 self[prefix + "minor"] = minor |
| 616 self[prefix + "build"] = build |
| 617 self[prefix + "patch"] = patch |
| 618 |
| 609 def SetVersion(self, version_file, prefix): | 619 def SetVersion(self, version_file, prefix): |
| 610 output = "" | 620 output = "" |
| 611 for line in FileToText(version_file).splitlines(): | 621 for line in FileToText(version_file).splitlines(): |
| 612 if line.startswith("#define MAJOR_VERSION"): | 622 if line.startswith("#define MAJOR_VERSION"): |
| 613 line = re.sub("\d+$", self[prefix + "major"], line) | 623 line = re.sub("\d+$", self[prefix + "major"], line) |
| 614 elif line.startswith("#define MINOR_VERSION"): | 624 elif line.startswith("#define MINOR_VERSION"): |
| 615 line = re.sub("\d+$", self[prefix + "minor"], line) | 625 line = re.sub("\d+$", self[prefix + "minor"], line) |
| 616 elif line.startswith("#define BUILD_NUMBER"): | 626 elif line.startswith("#define BUILD_NUMBER"): |
| 617 line = re.sub("\d+$", self[prefix + "build"], line) | 627 line = re.sub("\d+$", self[prefix + "build"], line) |
| 618 elif line.startswith("#define PATCH_LEVEL"): | 628 elif line.startswith("#define PATCH_LEVEL"): |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 for (number, step_class) in enumerate([BootstrapStep] + step_classes): | 804 for (number, step_class) in enumerate([BootstrapStep] + step_classes): |
| 795 steps.append(MakeStep(step_class, number, self._state, self._config, | 805 steps.append(MakeStep(step_class, number, self._state, self._config, |
| 796 options, self._side_effect_handler)) | 806 options, self._side_effect_handler)) |
| 797 for step in steps[options.step:]: | 807 for step in steps[options.step:]: |
| 798 if step.Run(): | 808 if step.Run(): |
| 799 return 0 | 809 return 0 |
| 800 return 0 | 810 return 0 |
| 801 | 811 |
| 802 def Run(self, args=None): | 812 def Run(self, args=None): |
| 803 return self.RunSteps(self._Steps(), args) | 813 return self.RunSteps(self._Steps(), args) |
| OLD | NEW |