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

Unified Diff: tools/push-to-trunk/merge_to_branch.py

Issue 166903012: Refactoring: Extract git checks in push and merge scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | tools/push-to-trunk/push_to_trunk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/merge_to_branch.py
diff --git a/tools/push-to-trunk/merge_to_branch.py b/tools/push-to-trunk/merge_to_branch.py
index 8e126b1b29012ef76aac126ac2dd9d4e2b2a118c..757e617f2d43442f9d10b2defb70517b4e6b276a 100755
--- a/tools/push-to-trunk/merge_to_branch.py
+++ b/tools/push-to-trunk/merge_to_branch.py
@@ -91,10 +91,8 @@ class CreateBranch(Step):
MESSAGE = "Create a fresh branch for the patch."
def RunStep(self):
- args = "checkout -b %s svn/%s" % (self.Config(BRANCHNAME),
- self["merge_to_branch"])
- if self.Git(args) is None:
- self.die("Creating branch %s failed." % self.Config(BRANCHNAME))
+ self.Git("checkout -b %s svn/%s" % (self.Config(BRANCHNAME),
+ self["merge_to_branch"]))
class SearchArchitecturePorts(Step):
@@ -226,24 +224,17 @@ class CommitLocal(Step):
MESSAGE = "Commit to local branch."
def RunStep(self):
- if self.Git("commit -a -F \"%s\"" % self.Config(COMMITMSG_FILE)) is None:
- self.Die("'git commit -a' failed.")
+ self.Git("commit -a -F \"%s\"" % self.Config(COMMITMSG_FILE))
class CommitRepository(Step):
MESSAGE = "Commit to the repository."
def RunStep(self):
- if self.Git("checkout %s" % self.Config(BRANCHNAME)) is None:
- self.Die("Cannot ensure that the current branch is %s"
- % self.Config(BRANCHNAME))
+ self.Git("checkout %s" % self.Config(BRANCHNAME))
self.WaitForLGTM()
- if self.Git("cl presubmit", "PRESUBMIT_TREE_CHECK=\"skip\"") is None:
- self.Die("Presubmit failed.")
-
- if self.Git("cl dcommit -f --bypass-hooks",
- retry_on=lambda x: x is None) is None:
- self.Die("Failed to commit to %s" % self._status["merge_to_branch"])
+ self.Git("cl presubmit", "PRESUBMIT_TREE_CHECK=\"skip\"")
+ self.Git("cl dcommit -f --bypass-hooks", retry_on=lambda x: x is None)
class PrepareSVN(Step):
@@ -252,8 +243,7 @@ class PrepareSVN(Step):
def RunStep(self):
if self._options.revert_bleeding_edge:
return
- if self.Git("svn fetch") is None:
- self.Die("'git svn fetch' failed.")
+ self.Git("svn fetch")
args = ("log -1 --format=%%H --grep=\"%s\" svn/%s"
% (self["new_commit_msg"], self["merge_to_branch"]))
commit_hash = self.Git(args).strip()
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | tools/push-to-trunk/push_to_trunk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698