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

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

Issue 607463002: Refactoring: Extract interface for VC in release scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review. Created 6 years, 3 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/merge_to_branch.py ('k') | tools/push-to-trunk/releases.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/push_to_trunk.py
diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py
index 8a9629e6021449c6b4dbcb98bd4753b68ba0981b..45ee2e8656794a4ce6a58856bb68a5ecfde2f26a 100755
--- a/tools/push-to-trunk/push_to_trunk.py
+++ b/tools/push-to-trunk/push_to_trunk.py
@@ -56,7 +56,8 @@ class FreshBranch(Step):
MESSAGE = "Create a fresh branch."
def RunStep(self):
- self.GitCreateBranch(self.Config("BRANCHNAME"), "svn/bleeding_edge")
+ self.GitCreateBranch(self.Config("BRANCHNAME"),
+ self.vc.RemoteMasterBranch())
class PreparePushRevision(Step):
@@ -64,7 +65,7 @@ class PreparePushRevision(Step):
def RunStep(self):
if self._options.revision:
- self["push_hash"] = self.GitSVNFindGitHash(self._options.revision)
+ self["push_hash"] = self.vc.SvnGit(self._options.revision)
else:
self["push_hash"] = self.GitLog(n=1, format="%H", git_hash="HEAD")
if not self["push_hash"]: # pragma: no cover
@@ -95,7 +96,7 @@ class DetectLastPush(Step):
if not last_push_be_svn: # pragma: no cover
self.Die("Could not retrieve bleeding edge revision for trunk push %s"
% last_push)
- last_push_bleeding_edge = self.GitSVNFindGitHash(last_push_be_svn)
+ last_push_bleeding_edge = self.vc.SvnGit(last_push_be_svn)
if not last_push_bleeding_edge: # pragma: no cover
self.Die("Could not retrieve bleeding edge git hash for trunk push %s"
% last_push)
@@ -116,7 +117,7 @@ class GetCurrentBleedingEdgeVersion(Step):
MESSAGE = "Get latest bleeding edge version."
def RunStep(self):
- self.GitCheckoutFile(VERSION_FILE, "svn/bleeding_edge")
+ self.GitCheckoutFile(VERSION_FILE, self.vc.RemoteMasterBranch())
# Store latest version.
self.ReadAndPersistVersion("latest_")
@@ -140,7 +141,7 @@ class IncrementVersion(Step):
if SortingKey(self["trunk_version"]) < SortingKey(self["latest_version"]):
# If the version on bleeding_edge is newer than on trunk, use it.
- self.GitCheckoutFile(VERSION_FILE, "svn/bleeding_edge")
+ self.GitCheckoutFile(VERSION_FILE, self.vc.RemoteMasterBranch())
self.ReadAndPersistVersion()
if self.Confirm(("Automatically increment BUILD_NUMBER? (Saying 'n' will "
@@ -249,8 +250,8 @@ class StragglerCommits(Step):
"started.")
def RunStep(self):
- self.GitSVNFetch()
- self.GitCheckout("svn/bleeding_edge")
+ self.vc.Fetch()
+ self.GitCheckout(self.vc.RemoteMasterBranch())
class SquashCommits(Step):
@@ -259,7 +260,8 @@ class SquashCommits(Step):
def RunStep(self):
# Instead of relying on "git rebase -i", we'll just create a diff, because
# that's easier to automate.
- TextToFile(self.GitDiff("svn/trunk", self["push_hash"]),
+ TextToFile(self.GitDiff(self.vc.RemoteCandidateBranch(),
+ self["push_hash"]),
self.Config("PATCH_FILE"))
# Convert the ChangeLog entry to commit message format.
@@ -270,7 +272,7 @@ class SquashCommits(Step):
# Retrieve svn revision for showing the used bleeding edge revision in the
# commit message.
- self["svn_revision"] = self.GitSVNFindSVNRev(self["push_hash"])
+ self["svn_revision"] = self.vc.GitSvn(self["push_hash"])
suffix = PUSH_MESSAGE_SUFFIX % int(self["svn_revision"])
text = MSub(r"^(Version \d+\.\d+\.\d+)$", "\\1%s" % suffix, text)
@@ -290,7 +292,8 @@ class NewBranch(Step):
MESSAGE = "Create a new branch from trunk."
def RunStep(self):
- self.GitCreateBranch(self.Config("TRUNKBRANCH"), "svn/trunk")
+ self.GitCreateBranch(self.Config("TRUNKBRANCH"),
+ self.vc.RemoteCandidateBranch())
class ApplyChanges(Step):
@@ -308,7 +311,8 @@ class AddChangeLog(Step):
# The change log has been modified by the patch. Reset it to the version
# on trunk and apply the exact changes determined by this PrepareChangeLog
# step above.
- self.GitCheckoutFile(self.Config("CHANGELOG_FILE"), "svn/trunk")
+ self.GitCheckoutFile(self.Config("CHANGELOG_FILE"),
+ self.vc.RemoteCandidateBranch())
changelog_entry = FileToText(self.Config("CHANGELOG_ENTRY_FILE"))
old_change_log = FileToText(self.Config("CHANGELOG_FILE"))
new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log)
@@ -322,7 +326,7 @@ class SetVersion(Step):
def RunStep(self):
# The version file has been modified by the patch. Reset it to the version
# on trunk and apply the correct version.
- self.GitCheckoutFile(VERSION_FILE, "svn/trunk")
+ self.GitCheckoutFile(VERSION_FILE, self.vc.RemoteCandidateBranch())
self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_")
@@ -350,7 +354,8 @@ class CommitSVN(Step):
MESSAGE = "Commit to SVN."
def RunStep(self):
- result = self.GitSVNDCommit()
+ result = self.vc.Land()
+ # TODO(machenbach): Remove/improve this logic before the git switch.
if not result: # pragma: no cover
self.Die("'git svn dcommit' failed.")
result = filter(lambda x: re.search(r"^Committed r[0-9]+", x),
@@ -374,7 +379,7 @@ class TagRevision(Step):
MESSAGE = "Tag the new revision."
def RunStep(self):
- self.GitSVNTag(self["version"])
+ self.vc.Tag(self["version"])
class CleanUp(Step):
« no previous file with comments | « tools/push-to-trunk/merge_to_branch.py ('k') | tools/push-to-trunk/releases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698