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 self["current_branch"] = self.GitCurrentBranch() | 599 self["current_branch"] = self.GitCurrentBranch() |
600 | 600 |
601 # Fetch unfetched revisions. | 601 # Fetch unfetched revisions. |
602 self.vc.Fetch() | 602 self.vc.Fetch() |
603 | 603 |
604 def PrepareBranch(self): | 604 def PrepareBranch(self): |
605 # Delete the branch that will be created later if it exists already. | 605 # Delete the branch that will be created later if it exists already. |
606 self.DeleteBranch(self._config["BRANCHNAME"]) | 606 self.DeleteBranch(self._config["BRANCHNAME"]) |
607 | 607 |
608 def CommonCleanup(self): | 608 def CommonCleanup(self): |
609 self.GitCheckout(self["current_branch"]) | 609 if ' ' in self["current_branch"]: |
| 610 self.GitCheckout('master') |
| 611 else: |
| 612 self.GitCheckout(self["current_branch"]) |
610 if self._config["BRANCHNAME"] != self["current_branch"]: | 613 if self._config["BRANCHNAME"] != self["current_branch"]: |
611 self.GitDeleteBranch(self._config["BRANCHNAME"]) | 614 self.GitDeleteBranch(self._config["BRANCHNAME"]) |
612 | 615 |
613 # Clean up all temporary files. | 616 # Clean up all temporary files. |
614 for f in glob.iglob("%s*" % self._config["PERSISTFILE_BASENAME"]): | 617 for f in glob.iglob("%s*" % self._config["PERSISTFILE_BASENAME"]): |
615 if os.path.isfile(f): | 618 if os.path.isfile(f): |
616 os.remove(f) | 619 os.remove(f) |
617 if os.path.isdir(f): | 620 if os.path.isdir(f): |
618 shutil.rmtree(f) | 621 shutil.rmtree(f) |
619 | 622 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 for (number, step_class) in enumerate(step_classes): | 883 for (number, step_class) in enumerate(step_classes): |
881 steps.append(MakeStep(step_class, number, self._state, self._config, | 884 steps.append(MakeStep(step_class, number, self._state, self._config, |
882 options, self._side_effect_handler)) | 885 options, self._side_effect_handler)) |
883 for step in steps[options.step:]: | 886 for step in steps[options.step:]: |
884 if step.Run(): | 887 if step.Run(): |
885 return 0 | 888 return 0 |
886 return 0 | 889 return 0 |
887 | 890 |
888 def Run(self, args=None): | 891 def Run(self, args=None): |
889 return self.RunSteps(self._Steps(), args) | 892 return self.RunSteps(self._Steps(), args) |
OLD | NEW |