Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: tools/release/common_includes.py

Issue 1003383003: Make release scripts even more robust. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/release/releases.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 def DieNoManualMode(self, msg=""): 504 def DieNoManualMode(self, msg=""):
505 if not self._options.manual: # pragma: no cover 505 if not self._options.manual: # pragma: no cover
506 msg = msg or "Only available in manual mode." 506 msg = msg or "Only available in manual mode."
507 self.Die(msg) 507 self.Die(msg)
508 508
509 def Confirm(self, msg): 509 def Confirm(self, msg):
510 print "%s [Y/n] " % msg, 510 print "%s [Y/n] " % msg,
511 answer = self.ReadLine(default="Y") 511 answer = self.ReadLine(default="Y")
512 return answer == "" or answer == "Y" or answer == "y" 512 return answer == "" or answer == "Y" or answer == "y"
513 513
514 def DeleteBranch(self, name): 514 def DeleteBranch(self, name, cwd=None):
515 for line in self.GitBranch().splitlines(): 515 for line in self.GitBranch(cwd=cwd).splitlines():
516 if re.match(r"\*?\s*%s$" % re.escape(name), line): 516 if re.match(r"\*?\s*%s$" % re.escape(name), line):
517 msg = "Branch %s exists, do you want to delete it?" % name 517 msg = "Branch %s exists, do you want to delete it?" % name
518 if self.Confirm(msg): 518 if self.Confirm(msg):
519 self.GitDeleteBranch(name) 519 self.GitDeleteBranch(name, cwd=cwd)
520 print "Branch %s deleted." % name 520 print "Branch %s deleted." % name
521 else: 521 else:
522 msg = "Can't continue. Please delete branch %s and try again." % name 522 msg = "Can't continue. Please delete branch %s and try again." % name
523 self.Die(msg) 523 self.Die(msg)
524 524
525 def InitialEnvironmentChecks(self, cwd): 525 def InitialEnvironmentChecks(self, cwd):
526 # Cancel if this is not a git checkout. 526 # Cancel if this is not a git checkout.
527 if not os.path.exists(os.path.join(cwd, ".git")): # pragma: no cover 527 if not os.path.exists(os.path.join(cwd, ".git")): # pragma: no cover
528 self.Die("This is not a git checkout, this script won't work for you.") 528 self.Die("This is not a git checkout, this script won't work for you.")
529 529
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 for (number, step_class) in enumerate([BootstrapStep] + step_classes): 872 for (number, step_class) in enumerate([BootstrapStep] + step_classes):
873 steps.append(MakeStep(step_class, number, self._state, self._config, 873 steps.append(MakeStep(step_class, number, self._state, self._config,
874 options, self._side_effect_handler)) 874 options, self._side_effect_handler))
875 for step in steps[options.step:]: 875 for step in steps[options.step:]:
876 if step.Run(): 876 if step.Run():
877 return 0 877 return 0
878 return 0 878 return 0
879 879
880 def Run(self, args=None): 880 def Run(self, args=None):
881 return self.RunSteps(self._Steps(), args) 881 return self.RunSteps(self._Steps(), args)
OLDNEW
« no previous file with comments | « no previous file | tools/release/releases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698