Fix svn tags in release scripts.
authormachenbach@chromium.org <machenbach@chromium.org>
Tue, 30 Sep 2014 13:12:44 +0000 (13:12 +0000)
committermachenbach@chromium.org <machenbach@chromium.org>
Tue, 30 Sep 2014 13:12:44 +0000 (13:12 +0000)
Rebase the local branch after committing so that git svn
tag works.

Some of these changes need to be ported to git in https://codereview.chromium.org/607893004/

BUG=chromium:410721,v8:3601
LOG=n
TEST=script_test.py
R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/push-to-trunk/auto_tag.py
tools/push-to-trunk/common_includes.py
tools/push-to-trunk/merge_to_branch.py
tools/push-to-trunk/push_to_trunk.py
tools/push-to-trunk/test_scripts.py

index 7b82e83..5ba7f76 100755 (executable)
@@ -152,7 +152,8 @@ class MakeTag(Step):
   def RunStep(self):
     if not self._options.dry_run:
       self.GitReset(self["lkgr"])
-      self.vc.Tag(self["candidate_version"])
+      # FIXME(machenbach): Make this work with the git repo.
+      self.vc.Tag(self["candidate_version"], "svn/bleeding_edge")
 
 
 class CleanUp(Step):
index 7ea39f7..f015601 100644 (file)
@@ -295,7 +295,7 @@ class VCInterface(object):
   # TODO(machenbach): There is some svn knowledge in this interface. In svn,
   # tag and commit are different remote commands, while in git we would commit
   # and tag locally and then push/land in one unique step.
-  def Tag(self, tag):
+  def Tag(self, tag, remote):
     raise NotImplementedError()
 
 
@@ -342,7 +342,9 @@ class GitSvnInterface(VCInterface):
   def CLLand(self):
     self.step.GitDCommit()
 
-  def Tag(self, tag):
+  def Tag(self, tag, remote):
+    self.step.GitSVNFetch()
+    self.step.Git("rebase %s" % remote)
     self.step.GitSVNTag(tag)
 
 
index 006afbb..9a9e65c 100755 (executable)
@@ -220,7 +220,7 @@ class TagRevision(Step):
     if self._options.revert_bleeding_edge:
       return
     print "Creating tag svn/tags/%s" % self["version"]
-    self.vc.Tag(self["version"])
+    self.vc.Tag(self["version"], self.vc.RemoteBranch(self["merge_to_branch"]))
 
 
 class CleanUp(Step):
index 184617d..ce18da4 100755 (executable)
@@ -361,7 +361,7 @@ class TagRevision(Step):
   MESSAGE = "Tag the new revision."
 
   def RunStep(self):
-    self.vc.Tag(self["version"])
+    self.vc.Tag(self["version"], self.vc.RemoteCandidateBranch())
 
 
 class CleanUp(Step):
index 4edb348..0eb57e1 100644 (file)
@@ -791,6 +791,8 @@ Performance and stability improvements on all platforms.""", commit)
       expectations.append(RL("Y"))  # Sanity check.
     expectations += [
       Cmd("git svn dcommit 2>&1", ""),
+      Cmd("git svn fetch", ""),
+      Cmd("git rebase svn/trunk", ""),
       Cmd("git svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""),
       Cmd("git checkout -f some_branch", ""),
       Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
@@ -1143,6 +1145,8 @@ LOG=N
       Cmd("git cl presubmit", "Presubmit successfull\n"),
       Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n",
           cb=VerifySVNCommit),
+      Cmd("git svn fetch", ""),
+      Cmd("git rebase svn/trunk", ""),
       Cmd("git svn tag 3.22.5.1 -m \"Tagging version 3.22.5.1\"", ""),
       Cmd("git checkout -f some_branch", ""),
       Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
@@ -1272,6 +1276,9 @@ LOG=N
       Cmd("git cl presubmit", "Presubmit successfull\n"),
       Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n",
           cb=VerifySVNCommit),
+      # FIXME(machenbach): This won't work when setting tags on the git repo.
+      Cmd("git svn fetch", ""),
+      Cmd("git rebase origin/candidates", ""),
       Cmd("git svn tag 3.22.5.1 -m \"Tagging version 3.22.5.1\"", ""),
       Cmd("git checkout -f some_branch", ""),
       Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
@@ -1604,6 +1611,8 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
       Cmd("git svn find-rev r123", "hash123"),
       Cmd("git log -1 --format=%at hash123", "1"),
       Cmd("git reset --hard hash123", ""),
+      Cmd("git svn fetch", ""),
+      Cmd("git rebase svn/bleeding_edge", ""),
       Cmd("git svn tag 3.4.3 -m \"Tagging version 3.4.3\"", ""),
       Cmd("git checkout -f some_branch", ""),
       Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),