Fix branch for resetting change log in push-to-trunk.

The patch is applied to ChangeLog with the "--index" option, which already updates the index of the file. For resetting the ChangeLog to the trunk revision, the trunk branch needs to be stated explicitly in the checkout, otherwise it checks out the already patched HEAD.

TEST=tools/push-to-trunk/script_test.py
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/199993005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19996 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3daaba09
......@@ -63,9 +63,10 @@ class GitRecipesMixin(object):
assert name
self.Git(MakeArgs(["checkout -f", name]))
def GitCheckoutFile(self, name):
def GitCheckoutFile(self, name, branch):
assert name
self.Git(MakeArgs(["checkout -f --", name]))
assert branch
self.Git(MakeArgs(["checkout -f", branch, "--", name]))
@Strip
def GitCurrentBranch(self):
......
......@@ -318,7 +318,7 @@ 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))
self.GitCheckoutFile(self.Config(CHANGELOG_FILE), "svn/trunk")
changelog_entry = FileToText(self.Config(NEW_CHANGELOG_FILE))
old_change_log = FileToText(self.Config(CHANGELOG_FILE))
new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log)
......
......@@ -741,7 +741,7 @@ Performance and stability improvements on all platforms.""", commit)
Git("checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], "",
cb=ResetChangeLog),
Git("apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""),
Git("checkout -f -- %s" % TEST_CONFIG[CHANGELOG_FILE], "",
Git("checkout -f svn/trunk -- %s" % TEST_CONFIG[CHANGELOG_FILE], "",
cb=ResetChangeLog),
Git("add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""),
Git("commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment