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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 def CandidateBranch(self): | 324 def CandidateBranch(self): |
325 return "candidates" | 325 return "candidates" |
326 | 326 |
327 def RemoteMasterBranch(self): | 327 def RemoteMasterBranch(self): |
328 return "origin/master" | 328 return "origin/master" |
329 | 329 |
330 def RemoteCandidateBranch(self): | 330 def RemoteCandidateBranch(self): |
331 return "origin/candidates" | 331 return "origin/candidates" |
332 | 332 |
333 def RemoteBranch(self, name): | 333 def RemoteBranch(self, name): |
| 334 # Assume that if someone "fully qualified" the ref, they know what they |
| 335 # want. |
| 336 if name.startswith('refs/'): |
| 337 return name |
334 if name in ["candidates", "master"]: | 338 if name in ["candidates", "master"]: |
335 return "origin/%s" % name | 339 return "refs/remotes/origin/%s" % name |
336 return "branch-heads/%s" % name | 340 # Check if branch is in heads. |
| 341 if self.Git("show-ref refs/remotes/origin/%s" % name).strip(): |
| 342 return "refs/remotes/origin/%s" % name |
| 343 # Check if branch is in branch-heads. |
| 344 if self.Git("show-ref refs/remotes/branch-heads/%s" % name).strip(): |
| 345 return "refs/remotes/branch-heads/%s" % name |
| 346 self.Die("Can't find remote of %s" % name) |
337 | 347 |
338 def Tag(self, tag, remote, message): | 348 def Tag(self, tag, remote, message): |
339 # Wait for the commit to appear. Assumes unique commit message titles (this | 349 # Wait for the commit to appear. Assumes unique commit message titles (this |
340 # is the case for all automated merge and push commits - also no title is | 350 # is the case for all automated merge and push commits - also no title is |
341 # the prefix of another title). | 351 # the prefix of another title). |
342 commit = None | 352 commit = None |
343 for wait_interval in [3, 7, 15, 35, 45, 60]: | 353 for wait_interval in [3, 7, 15, 35, 45, 60]: |
344 self.step.Git("fetch") | 354 self.step.Git("fetch") |
345 commit = self.step.GitLog(n=1, format="%H", grep=message, branch=remote) | 355 commit = self.step.GitLog(n=1, format="%H", grep=message, branch=remote) |
346 if commit: | 356 if commit: |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 for (number, step_class) in enumerate([BootstrapStep] + step_classes): | 872 for (number, step_class) in enumerate([BootstrapStep] + step_classes): |
863 steps.append(MakeStep(step_class, number, self._state, self._config, | 873 steps.append(MakeStep(step_class, number, self._state, self._config, |
864 options, self._side_effect_handler)) | 874 options, self._side_effect_handler)) |
865 for step in steps[options.step:]: | 875 for step in steps[options.step:]: |
866 if step.Run(): | 876 if step.Run(): |
867 return 0 | 877 return 0 |
868 return 0 | 878 return 0 |
869 | 879 |
870 def Run(self, args=None): | 880 def Run(self, args=None): |
871 return self.RunSteps(self._Steps(), args) | 881 return self.RunSteps(self._Steps(), args) |
OLD | NEW |