diff --git a/WATCHLISTS b/WATCHLISTS index 29b957b091..f0dde00dba 100644 --- a/WATCHLISTS +++ b/WATCHLISTS @@ -60,6 +60,9 @@ }, 'ia32': { 'filepath': '/ia32/', + }, + 'merges': { + 'filepath': '.', } }, @@ -91,5 +94,9 @@ 'ia32': [ 'v8-x87-ports@googlegroups.com', ], + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + # 'v8-merges@googlegroups.com', + ], }, } diff --git a/tools/release/common_includes.py b/tools/release/common_includes.py index 61d60f1640..c3a216c664 100644 --- a/tools/release/common_includes.py +++ b/tools/release/common_includes.py @@ -50,6 +50,7 @@ DAY_IN_SECONDS = 24 * 60 * 60 PUSH_MSG_GIT_RE = re.compile(r".* \(based on (?P[a-fA-F0-9]+)\)$") PUSH_MSG_NEW_RE = re.compile(r"^Version \d+\.\d+\.\d+$") VERSION_FILE = os.path.join("include", "v8-version.h") +WATCHLISTS_FILE = "WATCHLISTS" # V8 base directory. V8_BASE = os.path.dirname( diff --git a/tools/release/create_release.py b/tools/release/create_release.py index 3bbb50e491..7477ea1461 100755 --- a/tools/release/create_release.py +++ b/tools/release/create_release.py @@ -11,7 +11,6 @@ import urllib2 from common_includes import * - class Preparation(Step): MESSAGE = "Preparation." @@ -164,6 +163,7 @@ class MakeBranch(Step): self.Git("checkout -b work-branch %s" % self["push_hash"]) self.GitCheckoutFile(CHANGELOG_FILE, self["latest_version"]) self.GitCheckoutFile(VERSION_FILE, self["latest_version"]) + self.GitCheckoutFile(WATCHLISTS_FILE, self["latest_version"]) class AddChangeLog(Step): @@ -183,6 +183,19 @@ class SetVersion(Step): self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_") +class EnableMergeWatchlist(Step): + MESSAGE = "Enable watchlist entry for merge notifications." + + def RunStep(self): + old_watchlist_content = FileToText(os.path.join(self.default_cwd, + WATCHLISTS_FILE)) + new_watchlist_content = re.sub("(# 'v8-merges@googlegroups\.com',)", + "'v8-merges@googlegroups.com',", + old_watchlist_content) + TextToFile(new_watchlist_content, os.path.join(self.default_cwd, + WATCHLISTS_FILE)) + + class CommitBranch(Step): MESSAGE = "Commit version and changelog to new branch." @@ -288,6 +301,7 @@ class CreateRelease(ScriptsBase): MakeBranch, AddChangeLog, SetVersion, + EnableMergeWatchlist, CommitBranch, PushBranch, TagRevision, diff --git a/tools/release/test_scripts.py b/tools/release/test_scripts.py index 07f5c40c3b..4f133ac28a 100644 --- a/tools/release/test_scripts.py +++ b/tools/release/test_scripts.py @@ -389,6 +389,20 @@ class ScriptTest(unittest.TestCase): f.write(" // Some line...\n") f.write("#define V8_IS_CANDIDATE_VERSION 0\n") + def WriteFakeWatchlistsFile(self): + watchlists_file = os.path.join(TEST_CONFIG["DEFAULT_CWD"], WATCHLISTS_FILE) + if not os.path.exists(os.path.dirname(watchlists_file)): + os.makedirs(os.path.dirname(watchlists_file)) + with open(watchlists_file, "w") as f: + + content = """ + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + # 'v8-merges@googlegroups.com', + ], +""" + f.write(content) + def MakeStep(self): """Convenience wrapper.""" options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) @@ -952,6 +966,8 @@ Performance and stability improvements on all platforms.""" Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", cb=self.WriteFakeVersionFile), + Cmd("git checkout -f 3.22.4 -- WATCHLISTS", "", + cb=self.WriteFakeWatchlistsFile), Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", cb=CheckVersionCommit), Cmd("git push origin " @@ -983,6 +999,18 @@ Performance and stability improvements on all platforms.""" # Note: The version file is on build number 5 again in the end of this test # since the git command that merges to master is mocked out. + # Check for correct content of the WATCHLISTS file + + watchlists_content = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], + WATCHLISTS_FILE)) + expected_watchlists_content = """ + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + 'v8-merges@googlegroups.com', + ], +""" + self.assertEqual(watchlists_content, expected_watchlists_content) + C_V8_22624_LOG = """V8 CL. git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123