def GetBranches(self):
raise NotImplementedError()
- def GitSvn(self, hsh, branch=""):
- raise NotImplementedError()
-
- def SvnGit(self, rev, branch=""):
- raise NotImplementedError()
-
def MasterBranch(self):
raise NotImplementedError()
def CLLand(self):
raise NotImplementedError()
- # 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, remote, message):
"""Sets a tag for the current commit.
raise NotImplementedError()
-class GitSvnInterface(VCInterface):
- def Pull(self):
- self.step.GitSVNRebase()
-
- def Fetch(self):
- self.step.GitSVNFetch()
-
- def GetTags(self):
- # Get remote tags.
- tags = filter(lambda s: re.match(r"^svn/tags/[\d+\.]+$", s),
- self.step.GitRemotes())
-
- # Remove 'svn/tags/' prefix.
- return map(lambda s: s[9:], tags)
-
- def GetBranches(self):
- # Get relevant remote branches, e.g. "svn/3.25".
- branches = filter(lambda s: re.match(r"^svn/\d+\.\d+$", s),
- self.step.GitRemotes())
- # Remove 'svn/' prefix.
- return map(lambda s: s[4:], branches)
-
- def GitSvn(self, hsh, branch=""):
- return self.step.GitSVNFindSVNRev(hsh, branch)
-
- def SvnGit(self, rev, branch=""):
- return self.step.GitSVNFindGitHash(rev, branch)
-
- def MasterBranch(self):
- return "bleeding_edge"
-
- def CandidateBranch(self):
- return "trunk"
-
- def RemoteMasterBranch(self):
- return "svn/bleeding_edge"
-
- def RemoteCandidateBranch(self):
- return "svn/trunk"
-
- def RemoteBranch(self, name):
- return "svn/%s" % name
-
- def Land(self):
- self.step.GitSVNDCommit()
-
- def CLLand(self):
- self.step.GitDCommit()
-
- def Tag(self, tag, remote, _):
- self.step.GitSVNFetch()
- self.step.Git("rebase %s" % remote)
- self.step.GitSVNTag(tag)
-
-
-class GitTagsOnlyMixin(VCInterface):
+class GitInterface(VCInterface):
def Pull(self):
self.step.GitPull()
def Fetch(self):
self.step.Git("fetch")
- self.step.GitSVNFetch()
def GetTags(self):
return self.step.Git("tag").strip().splitlines()
return "origin/%s" % name
return "branch-heads/%s" % name
- def PushRef(self, ref):
- self.step.Git("push origin %s" % ref)
-
def Tag(self, tag, remote, message):
# Wait for the commit to appear. Assumes unique commit message titles (this
# is the case for all automated merge and push commits - also no title is
"git updater is lagging behind?")
self.step.Git("tag %s %s" % (tag, commit))
- self.PushRef(tag)
-
-
-class GitReadSvnWriteInterface(GitTagsOnlyMixin, GitSvnInterface):
- pass
-
-
-class GitInterface(GitTagsOnlyMixin):
- def Fetch(self):
- self.step.Git("fetch")
-
- def GitSvn(self, hsh, branch=""):
- return ""
-
- def SvnGit(self, rev, branch=""):
- raise NotImplementedError()
+ self.step.Git("push origin %s" % tag)
def Land(self):
- # FIXME(machenbach): This will not work with checkouts from bot_update
- # after flag day because it will push to the cache. Investigate if it
- # will work with "cl land".
self.step.Git("push origin")
def CLLand(self):
self.step.GitCLLand()
- def PushRef(self, ref):
- self.step.Git("push https://chromium.googlesource.com/v8/v8 %s" % ref)
-
-
-VC_INTERFACES = {
- "git_svn": GitSvnInterface,
- "git_read_svn_write": GitReadSvnWriteInterface,
- "git": GitInterface,
-}
-
class Step(GitRecipesMixin):
def __init__(self, text, number, config, state, options, handler):
self._state = state
self._options = options
self._side_effect_handler = handler
- self.vc = VC_INTERFACES[options.vc_interface]()
+ self.vc = GitInterface()
self.vc.InjectStep(self)
# The testing configuration might set a different default cwd.
raise GitFailedException("'git %s' failed." % args)
return result
- def SVN(self, args="", prefix="", pipe=True, retry_on=None, cwd=None):
- cmd = lambda: self._side_effect_handler.Command(
- "svn", args, prefix, pipe, cwd=cwd or self.default_cwd)
- return self.Retry(cmd, retry_on, [5, 30])
-
def Editor(self, args):
if self._options.requires_editor:
return self._side_effect_handler.Command(
output += "%s\n" % line
TextToFile(output, version_file)
- def SVNCommit(self, root, commit_message):
- patch = self.GitDiff("HEAD^", "HEAD")
- TextToFile(patch, self._config["PATCH_FILE"])
- self.Command("svn", "update", cwd=self._options.svn)
- if self.Command("svn", "status", cwd=self._options.svn) != "":
- self.Die("SVN checkout not clean.")
- if not self.Command("patch", "-d %s -p1 -i %s" %
- (root, self._config["PATCH_FILE"]),
- cwd=self._options.svn):
- self.Die("Could not apply patch.")
- for line in self.Command(
- "svn", "status", cwd=self._options.svn).splitlines():
- # Check for added and removed items. Svn status has seven status columns.
- # The first contains ? for unknown and ! for missing.
- match = re.match(r"^(.)...... (.*)$", line)
- if match and match.group(1) == "?":
- self.Command("svn", "add --force %s" % match.group(2),
- cwd=self._options.svn)
- if match and match.group(1) == "!":
- self.Command("svn", "delete --force %s" % match.group(2),
- cwd=self._options.svn)
-
- self.Command(
- "svn",
- "commit --non-interactive --username=%s --config-dir=%s -m \"%s\"" %
- (self._options.author, self._options.svn_config, commit_message),
- cwd=self._options.svn)
-
class BootstrapStep(Step):
MESSAGE = "Bootstapping v8 checkout."
help=("Determine current sheriff to review CLs. On "
"success, this will overwrite the reviewer "
"option."))
- parser.add_argument("--svn",
- help=("Optional full svn checkout for the commit."
- "The folder needs to be the svn root."))
- parser.add_argument("--svn-config",
- help=("Optional folder used as svn --config-dir."))
parser.add_argument("-s", "--step",
help="Specify the step where to start work. Default: 0.",
default=0, type=int)
- parser.add_argument("--vc-interface",
- help=("Choose VC interface out of git_svn|"
- "git_read_svn_write."))
parser.add_argument("--work-dir",
help=("Location where to bootstrap a working v8 "
"checkout."))
print "To determine the current sheriff, requires the googler mapping"
parser.print_help()
return None
- if options.svn and not options.svn_config:
- print "Using pure svn for committing requires also --svn-config"
- parser.print_help()
- return None
# Defaults for options, common to all scripts.
options.manual = getattr(options, "manual", True)
parser.print_help()
return None
- if not options.vc_interface:
- options.vc_interface = "git_read_svn_write"
if not options.work_dir:
options.work_dir = "/tmp/v8-release-scripts-work-dir"
return options
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
RL("Y"),
Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
RL("n"),
])
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
RL("Y"),
Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], None),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep=\"Title\" origin/candidates", ""),
])
- args = ["--branch", "candidates", "--vc-interface", "git_read_svn_write",
- "ab12345"]
+ args = ["--branch", "candidates", "ab12345"]
self._state["version"] = "tag_name"
self._state["commit_title"] = "Title"
self.assertRaises(Exception,
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* branch2\n"),
Cmd("git branch", " branch1\n* branch2\n"),
+ Cmd("git config --get remote.origin.push", ""),
+ Cmd("git config --add remote.origin.push "
+ "refs/remotes/origin/candidates:refs/pending/heads/candidates", ""),
Cmd(("git new-branch %s --upstream origin/master" %
TEST_CONFIG["BRANCHNAME"]),
""),
Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], ""))
expectations += [
Cmd("git fetch", ""),
- Cmd("git svn fetch", "fetch result\n"),
Cmd("git checkout -f origin/master", ""),
Cmd("git diff origin/candidates push_hash", "patch content\n"),
Cmd(("git new-branch %s --upstream origin/candidates" %
if manual:
expectations.append(RL("Y")) # Sanity check.
expectations += [
- Cmd("git svn dcommit 2>&1", ""),
+ Cmd("git push origin", ""),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep="
"\"Version 3.22.5 (based on push_hash)\""
]
self.Expect(expectations)
- args = ["-a", "author@chromium.org", "--revision", "push_hash",
- "--vc-interface", "git_read_svn_write",]
+ args = ["-a", "author@chromium.org", "--revision", "push_hash"]
if force: args.append("-f")
if manual: args.append("-m")
else: args += ["-r", "reviewer@chromium.org"]
def testPushToTrunkForced(self):
self._PushToTrunk(force=True)
- def testPushToTrunkGit(self):
- svn_root = self.MakeEmptyTempDirectory()
- TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
-
- # The version file on bleeding edge has build level 5, while the version
- # file from trunk has build level 4.
- self.WriteFakeVersionFile(build=5)
-
- TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
- bleeding_edge_change_log = "2014-03-17: Sentinel\n"
- TextToFile(bleeding_edge_change_log,
- os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
-
- def ResetChangeLog():
- """On 'git co -b new_branch svn/trunk', and 'git checkout -- ChangeLog',
- the ChangLog will be reset to its content on trunk."""
- trunk_change_log = """1999-04-05: Version 3.22.4
-
- Performance and stability improvements on all platforms.\n"""
- TextToFile(trunk_change_log,
- os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
-
- def ResetToTrunk():
- ResetChangeLog()
- self.WriteFakeVersionFile()
-
- def CheckSVNCommit():
- commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
- self.assertEquals(
-"""Version 3.22.5 (based on push_hash)
-
-Log text 1 (issue 321).
-
-Performance and stability improvements on all platforms.""", commit)
- version = FileToText(
- os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE))
- self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version))
- self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version))
- self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version))
- self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version))
- self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
-
- # Check that the change log on the trunk branch got correctly modified.
- change_log = FileToText(
- os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
- self.assertEquals(
-"""1999-07-31: Version 3.22.5
-
- Log text 1 (issue 321).
-
- Performance and stability improvements on all platforms.
-
-
-1999-04-05: Version 3.22.4
-
- Performance and stability improvements on all platforms.\n""",
- change_log)
-
- expectations = [
- Cmd("git status -s -uno", ""),
- Cmd("git status -s -b -uno", "## some_branch\n"),
- Cmd("git fetch", ""),
- Cmd("git branch", " branch1\n* branch2\n"),
- Cmd("git branch", " branch1\n* branch2\n"),
- Cmd(("git new-branch %s --upstream origin/master" %
- TEST_CONFIG["BRANCHNAME"]),
- ""),
- Cmd(("git log -1 --format=%H --grep="
- "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
- "origin/candidates"), "hash2\n"),
- Cmd("git log -1 hash2", "Log message\n"),
- Cmd("git log -1 --format=%s hash2",
- "Version 3.4.5 (based on abc3)\n"),
- Cmd("git checkout -f origin/master -- src/version.cc",
- "", cb=self.WriteFakeVersionFile),
- Cmd("git checkout -f hash2 -- src/version.cc", "",
- cb=self.WriteFakeVersionFile),
- Cmd("git log --format=%H abc3..push_hash", "rev1\n"),
- Cmd("git log -1 --format=%s rev1", "Log text 1.\n"),
- Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"),
- Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"),
- Cmd("git fetch", ""),
- Cmd("git checkout -f origin/master", ""),
- Cmd("git diff origin/candidates push_hash", "patch content\n"),
- Cmd(("git new-branch %s --upstream origin/candidates" %
- TEST_CONFIG["TRUNKBRANCH"]), "", cb=ResetToTrunk),
- Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG["PATCH_FILE"], ""),
- Cmd("git checkout -f origin/candidates -- ChangeLog", "",
- cb=ResetChangeLog),
- Cmd("git checkout -f origin/candidates -- src/version.cc", "",
- cb=self.WriteFakeVersionFile),
- Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
- cb=CheckSVNCommit),
- # TODO(machenbach): Change test to pure git after flag day.
- # Cmd("git push origin", ""),
- Cmd("git diff HEAD^ HEAD", "patch content"),
- Cmd("svn update", "", cwd=svn_root),
- Cmd("svn status", "", cwd=svn_root),
- Cmd("patch -d trunk -p1 -i %s" %
- TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root),
- Cmd("svn status", "M OWNERS\n? new_file\n! AUTHORS",
- cwd=svn_root),
- Cmd("svn add --force new_file", "", cwd=svn_root),
- Cmd("svn delete --force AUTHORS", "", cwd=svn_root),
- Cmd("svn commit --non-interactive --username=author@chromium.org "
- "--config-dir=[CONFIG_DIR] "
- "-m \"Version 3.22.5 (based on push_hash)\"",
- "", cwd=svn_root),
- Cmd("git fetch", ""),
- Cmd("git log -1 --format=%H --grep="
- "\"Version 3.22.5 (based on push_hash)\""
- " origin/candidates", "hsh_to_tag"),
- Cmd("git tag 3.22.5 hsh_to_tag", ""),
- Cmd("git push https://chromium.googlesource.com/v8/v8 3.22.5", ""),
- Cmd("git checkout -f some_branch", ""),
- Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
- Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""),
- ]
- self.Expect(expectations)
-
- args = ["-a", "author@chromium.org", "--revision", "push_hash",
- "--vc-interface", "git", "-f", "-r", "reviewer@chromium.org",
- "--svn", svn_root, "--svn-config", "[CONFIG_DIR]",
- "--work-dir", TEST_CONFIG["DEFAULT_CWD"]]
- PushToTrunk(TEST_CONFIG, self).Run(args)
-
- cl = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
- self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl))
- self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl))
- self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl))
-
- # Note: The version file is on build number 5 again in the end of this test
- # since the git command that merges to the bleeding edge branch is mocked
- # out.
-
C_V8_22624_LOG = """V8 CL.
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123
"Version 3.4.5 (based on abc101)\n"),
])
- auto_push.AutoPush(TEST_CONFIG, self).Run(
- AUTO_PUSH_ARGS + ["--push", "--vc-interface", "git"])
+ auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"])
state = json.loads(FileToText("%s-state.json"
% TEST_CONFIG["PERSISTFILE_BASENAME"]))
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
])
def RunAutoPush():
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
URL("https://v8-status.appspot.com/current?format=json",
"{\"message\": \"Tree is throttled (no push)\"}"),
])
"owner=author%40chromium.org&limit=30&closed=3&format=json",
("{\"results\": [{\"subject\": \"different\"}]}")),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd(("git log -1 --format=%H --grep="
"\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
"origin/candidates"), "push_hash\n"),
"owner=author%40chromium.org&limit=30&closed=3&format=json",
("{\"results\": [{\"subject\": \"different\"}]}")),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd(("git log -1 --format=%H --grep="
"\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
"origin/candidates"), "push_hash\n"),
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* branch2\n"),
Cmd("git new-branch %s --upstream origin/candidates" %
TEST_CONFIG["BRANCHNAME"], ""),
Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""),
RL("LGTM"), # Enter LGTM for V8 CL.
Cmd("git cl presubmit", "Presubmit successfull\n"),
- Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n",
+ Cmd("git cl land -f --bypass-hooks", "Closing issue\n",
cb=VerifySVNCommit),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep=\""
MergeToBranch(TEST_CONFIG, self).Run(args)
def testReleases(self):
- tag_response_text = """
-------------------------------------------------------------------------
-r22631 | author1@chromium.org | 2014-07-28 02:05:29 +0200 (Mon, 28 Jul 2014)
-Changed paths:
- A /tags/3.28.43 (from /trunk:22630)
-
-Tagging version 3.28.43
-------------------------------------------------------------------------
-r22629 | author2@chromium.org | 2014-07-26 05:09:29 +0200 (Sat, 26 Jul 2014)
-Changed paths:
- A /tags/3.28.41 (from /branches/bleeding_edge:22626)
-
-Tagging version 3.28.41
-------------------------------------------------------------------------
-r22556 | author3@chromium.org | 2014-07-23 13:31:59 +0200 (Wed, 23 Jul 2014)
-Changed paths:
- A /tags/3.27.34.7 (from /branches/3.27:22555)
-
-Tagging version 3.27.34.7
-------------------------------------------------------------------------
-r22627 | author4@chromium.org | 2014-07-26 01:39:15 +0200 (Sat, 26 Jul 2014)
-Changed paths:
- A /tags/3.28.40 (from /branches/bleeding_edge:22624)
-
-Tagging version 3.28.40
-------------------------------------------------------------------------
-"""
c_hash2_commit_log = """Revert something.
BUG=12345
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
"""
+ c_hash_234_commit_log = """Version 3.3.1.1 (cherry-pick).
+
+Merged abc12.
+
+Review URL: fake.com
+
+Cr-Commit-Position: refs/heads/candidates@{#234}
+"""
+ c_hash_123_commit_log = """Version 3.3.1.0
+
+git-svn-id: googlecode@123 0039-1c4b
+"""
+ c_hash_345_commit_log = """Version 3.4.0.
+
+Cr-Commit-Position: refs/heads/candidates@{#345}
+"""
+
json_output = self.MakeEmptyTempFile()
csv_output = self.MakeEmptyTempFile()
self.WriteFakeVersionFile()
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
- Cmd("git svn fetch", ""),
Cmd("git branch", " branch1\n* branch2\n"),
Cmd("git new-branch %s" % TEST_CONFIG["BRANCHNAME"], ""),
Cmd("git branch -r", " branch-heads/3.21\n branch-heads/3.3\n"),
Cmd("git diff --name-only hash_234 hash_234^", VERSION_FILE),
Cmd("git checkout -f hash_234 -- %s" % VERSION_FILE, "",
cb=ResetVersion(3, 1, 1)),
- Cmd("git log -1 --format=%B hash_234",
- "Version 3.3.1.1 (cherry-pick).\n\n"
- "Merged abc12.\n\n"
- "Review URL: fake.com\n"),
+ Cmd("git log -1 --format=%B hash_234", c_hash_234_commit_log),
Cmd("git log -1 --format=%s hash_234", ""),
- Cmd("git svn find-rev hash_234", "234"),
+ Cmd("git log -1 --format=%B hash_234", c_hash_234_commit_log),
Cmd("git log -1 --format=%ci hash_234", "18:15"),
Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
cb=ResetVersion(22, 5)),
Cmd("git diff --name-only hash_123 hash_123^", VERSION_FILE),
Cmd("git checkout -f hash_123 -- %s" % VERSION_FILE, "",
cb=ResetVersion(21, 2)),
- Cmd("git log -1 --format=%B hash_123", ""),
+ Cmd("git log -1 --format=%B hash_123", c_hash_123_commit_log),
Cmd("git log -1 --format=%s hash_123", ""),
- Cmd("git svn find-rev hash_123", "123"),
+ Cmd("git log -1 --format=%B hash_123", c_hash_123_commit_log),
Cmd("git log -1 --format=%ci hash_123", "03:15"),
Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
cb=ResetVersion(22, 5)),
Cmd("git diff --name-only hash_345 hash_345^", VERSION_FILE),
Cmd("git checkout -f hash_345 -- %s" % VERSION_FILE, "",
cb=ResetVersion(22, 3)),
- Cmd("git log -1 --format=%B hash_345", ""),
+ Cmd("git log -1 --format=%B hash_345", c_hash_345_commit_log),
Cmd("git log -1 --format=%s hash_345", ""),
- Cmd("git svn find-rev hash_345", "345"),
+ Cmd("git log -1 --format=%B hash_345", c_hash_345_commit_log),
Cmd("git log -1 --format=%ci hash_345", ""),
Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
cb=ResetVersion(22, 5)),
Cmd("git reset --hard origin/master", ""),
- Cmd("svn log https://v8.googlecode.com/svn/tags -v --limit 20",
- tag_response_text),
- Cmd("git svn find-rev r22626", "hash_22626"),
- Cmd("git svn find-rev hash_22626", "22626"),
- Cmd("git log -1 --format=%ci hash_22626", "01:23"),
- Cmd("git svn find-rev r22624", "hash_22624"),
- Cmd("git svn find-rev hash_22624", "22624"),
- Cmd("git log -1 --format=%ci hash_22624", "02:34"),
Cmd("git status -s -uno", "", cwd=chrome_dir),
Cmd("git checkout -f master", "", cwd=chrome_dir),
Cmd("git pull", "", cwd=chrome_dir),
])
args = ["-c", TEST_CONFIG["CHROMIUM"],
- "--vc-interface", "git_read_svn_write",
"--json", json_output,
"--csv", csv_output,
"--max-releases", "1"]
Releases(TEST_CONFIG, self).Run(args)
# Check expected output.
- csv = ("3.28.41,master,22626,,\r\n"
- "3.28.40,master,22624,4567,\r\n"
- "3.22.3,candidates,345,3456:4566,\r\n"
+ csv = ("3.22.3,candidates,345,3456:4566,\r\n"
"3.21.2,3.21,123,,\r\n"
"3.3.1.1,3.3,234,,abc12\r\n")
self.assertEquals(csv, FileToText(csv_output))
expected_json = [
{
- "revision": "22626",
- "revision_git": "hash_22626",
- "bleeding_edge": "22626",
- "bleeding_edge_git": "hash_22626",
- "patches_merged": "",
- "version": "3.28.41",
- "chromium_revision": "",
- "branch": "master",
- "review_link": "",
- "date": "01:23",
- "chromium_branch": "",
- "revision_link": "https://code.google.com/p/v8/source/detail?r=22626",
- },
- {
- "revision": "22624",
- "revision_git": "hash_22624",
- "bleeding_edge": "22624",
- "bleeding_edge_git": "hash_22624",
- "patches_merged": "",
- "version": "3.28.40",
- "chromium_revision": "4567",
- "branch": "master",
- "review_link": "",
- "date": "02:34",
- "chromium_branch": "",
- "revision_link": "https://code.google.com/p/v8/source/detail?r=22624",
- },
- {
"revision": "345",
"revision_git": "hash_345",
"bleeding_edge": "",
expectations += [
Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f "
"--bypass-hooks", ""),
- Cmd("git cl dcommit -f --bypass-hooks", ""),
+ Cmd("git cl land -f --bypass-hooks", ""),
Cmd("git checkout -f master", ""),
Cmd("git branch", "auto-bump-up-version\n* master"),
Cmd("git branch -D auto-bump-up-version", ""),
BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"])
- def testBumpUpVersionSvn(self):
- svn_root = self.MakeEmptyTempDirectory()
- expectations = self._bumpUpVersion()
- expectations += [
- Cmd("git diff HEAD^ HEAD", "patch content"),
- Cmd("svn update", "", cwd=svn_root),
- Cmd("svn status", "", cwd=svn_root),
- Cmd("patch -d branches/bleeding_edge -p1 -i %s" %
- TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root),
- Cmd("svn status", "M src/version.cc", cwd=svn_root),
- Cmd("svn commit --non-interactive --username=author@chromium.org "
- "--config-dir=[CONFIG_DIR] "
- "-m \"[Auto-roll] Bump up version to 3.11.6.0\"",
- "", cwd=svn_root),
- Cmd("git checkout -f master", ""),
- Cmd("git branch", "auto-bump-up-version\n* master"),
- Cmd("git branch -D auto-bump-up-version", ""),
- ]
- self.Expect(expectations)
-
- BumpUpVersion(TEST_CONFIG, self).Run(
- ["-a", "author@chromium.org",
- "--svn", svn_root,
- "--svn-config", "[CONFIG_DIR]"])
# Test that we bail out if the last change was a version change.
def testBumpUpVersionBailout1(self):