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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 def RemoteCandidateBranch(self): | 331 def RemoteCandidateBranch(self): |
332 return "origin/candidates" | 332 return "origin/candidates" |
333 | 333 |
334 def RemoteBranch(self, name): | 334 def RemoteBranch(self, name): |
335 # Assume that if someone "fully qualified" the ref, they know what they | 335 # Assume that if someone "fully qualified" the ref, they know what they |
336 # want. | 336 # want. |
337 if name.startswith('refs/'): | 337 if name.startswith('refs/'): |
338 return name | 338 return name |
339 if name in ["candidates", "master"]: | 339 if name in ["candidates", "master"]: |
340 return "refs/remotes/origin/%s" % name | 340 return "refs/remotes/origin/%s" % name |
341 # Check if branch is in heads. | 341 try: |
342 if self.step.Git("show-ref refs/remotes/origin/%s" % name).strip(): | 342 # Check if branch is in heads. |
343 return "refs/remotes/origin/%s" % name | 343 if self.step.Git("show-ref refs/remotes/origin/%s" % name).strip(): |
344 # Check if branch is in branch-heads. | 344 return "refs/remotes/origin/%s" % name |
345 if self.step.Git("show-ref refs/remotes/branch-heads/%s" % name).strip(): | 345 except GitFailedException: |
346 return "refs/remotes/branch-heads/%s" % name | 346 pass |
| 347 try: |
| 348 # Check if branch is in branch-heads. |
| 349 if self.step.Git("show-ref refs/remotes/branch-heads/%s" % name).strip(): |
| 350 return "refs/remotes/branch-heads/%s" % name |
| 351 except GitFailedException: |
| 352 pass |
347 self.Die("Can't find remote of %s" % name) | 353 self.Die("Can't find remote of %s" % name) |
348 | 354 |
349 def Tag(self, tag, remote, message): | 355 def Tag(self, tag, remote, message): |
350 # Wait for the commit to appear. Assumes unique commit message titles (this | 356 # Wait for the commit to appear. Assumes unique commit message titles (this |
351 # is the case for all automated merge and push commits - also no title is | 357 # is the case for all automated merge and push commits - also no title is |
352 # the prefix of another title). | 358 # the prefix of another title). |
353 commit = None | 359 commit = None |
354 for wait_interval in [3, 7, 15, 35, 45, 60]: | 360 for wait_interval in [3, 7, 15, 35, 45, 60]: |
355 self.step.Git("fetch") | 361 self.step.Git("fetch") |
356 commit = self.step.GitLog(n=1, format="%H", grep=message, branch=remote) | 362 commit = self.step.GitLog(n=1, format="%H", grep=message, branch=remote) |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 for (number, step_class) in enumerate([BootstrapStep] + step_classes): | 889 for (number, step_class) in enumerate([BootstrapStep] + step_classes): |
884 steps.append(MakeStep(step_class, number, self._state, self._config, | 890 steps.append(MakeStep(step_class, number, self._state, self._config, |
885 options, self._side_effect_handler)) | 891 options, self._side_effect_handler)) |
886 for step in steps[options.step:]: | 892 for step in steps[options.step:]: |
887 if step.Run(): | 893 if step.Run(): |
888 return 0 | 894 return 0 |
889 return 0 | 895 return 0 |
890 | 896 |
891 def Run(self, args=None): | 897 def Run(self, args=None): |
892 return self.RunSteps(self._Steps(), args) | 898 return self.RunSteps(self._Steps(), args) |
OLD | NEW |