Commit 69e2570d authored by thakis's avatar thakis Committed by Commit bot

Get rid of LASTCHANGE.blink

Now that blink lives in the src repo, there's no need to generate a
separate LASTCHANGE file for it.

The LASTCHANGE line makes it into the user agent. LASTCHANGE.blink
used --git-hash-only to only have the git hash in there.  Remove
that now-unused flag and use version.py's -e flag to get the same
effect for webkit_version.h

Reverts parts of https://chromiumcodereview.appspot.com/14973005/
No intended behavior change.

BUG=none

Review-Url: https://codereview.chromium.org/1982423002
Cr-Commit-Position: refs/heads/master@{#465739}
parent 054d4e48
...@@ -837,15 +837,6 @@ hooks = [ ...@@ -837,15 +837,6 @@ hooks = [
'action': ['python', 'src/build/util/lastchange.py', 'action': ['python', 'src/build/util/lastchange.py',
'-o', 'src/build/util/LASTCHANGE'], '-o', 'src/build/util/LASTCHANGE'],
}, },
{
# Update LASTCHANGE.blink.
'name': 'lastchange_blink',
'pattern': '.',
'action': ['python', 'src/build/util/lastchange.py',
'--git-hash-only',
'-s', 'src/third_party/WebKit',
'-o', 'src/build/util/LASTCHANGE.blink'],
},
{ {
# Update skia_commit_hash.h. # Update skia_commit_hash.h.
'name': 'lastchange_skia', 'name': 'lastchange_skia',
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
action("webkit_version") { action("webkit_version") {
script = "version.py" script = "version.py"
lastchange_file = "LASTCHANGE.blink" lastchange_file = "LASTCHANGE"
template_file = "webkit_version.h.in" template_file = "webkit_version.h.in"
inputs = [ inputs = [
...@@ -19,6 +19,10 @@ action("webkit_version") { ...@@ -19,6 +19,10 @@ action("webkit_version") {
] ]
args = [ args = [
# LASTCHANGE contains "<build hash>-<ref>". The user agent only wants the
# "<build hash>" bit, so chop off everything after it.
"-e",
"LASTCHANGE=LASTCHANGE[:LASTCHANGE.find('-')]",
"-f", "-f",
rebase_path(lastchange_file, root_build_dir), rebase_path(lastchange_file, root_build_dir),
rebase_path(template_file, root_build_dir), rebase_path(template_file, root_build_dir),
......
...@@ -48,7 +48,7 @@ def RunGitCommand(directory, command): ...@@ -48,7 +48,7 @@ def RunGitCommand(directory, command):
return None return None
def FetchGitRevision(directory, hash_only): def FetchGitRevision(directory):
""" """
Fetch the Git hash for a given directory. Fetch the Git hash for a given directory.
...@@ -59,8 +59,6 @@ def FetchGitRevision(directory, hash_only): ...@@ -59,8 +59,6 @@ def FetchGitRevision(directory, hash_only):
""" """
hsh = '' hsh = ''
git_args = ['log', '-1', '--format=%H'] git_args = ['log', '-1', '--format=%H']
if hash_only:
git_args.append('--grep=^Cr-Commit-Position:')
proc = RunGitCommand(directory, git_args) proc = RunGitCommand(directory, git_args)
if proc: if proc:
output = proc.communicate()[0].strip() output = proc.communicate()[0].strip()
...@@ -77,14 +75,11 @@ def FetchGitRevision(directory, hash_only): ...@@ -77,14 +75,11 @@ def FetchGitRevision(directory, hash_only):
if line.startswith('Cr-Commit-Position:'): if line.startswith('Cr-Commit-Position:'):
pos = line.rsplit()[-1].strip() pos = line.rsplit()[-1].strip()
break break
if hash_only or not pos:
return VersionInfo('git', hsh)
return VersionInfo('git', '%s-%s' % (hsh, pos)) return VersionInfo('git', '%s-%s' % (hsh, pos))
def FetchVersionInfo(directory=None, def FetchVersionInfo(directory=None,
directory_regex_prior_to_src_url='chrome|blink|svn', directory_regex_prior_to_src_url='chrome|svn'):
hash_only=False):
""" """
Returns the last change (in the form of a branch, revision tuple), Returns the last change (in the form of a branch, revision tuple),
from some appropriate revision control system. from some appropriate revision control system.
...@@ -92,7 +87,7 @@ def FetchVersionInfo(directory=None, ...@@ -92,7 +87,7 @@ def FetchVersionInfo(directory=None,
svn_url_regex = re.compile( svn_url_regex = re.compile(
r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)') r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
version_info = FetchGitRevision(directory, hash_only) version_info = FetchGitRevision(directory)
if not version_info: if not version_info:
version_info = VersionInfo(None, None) version_info = VersionInfo(None, None)
return version_info return version_info
...@@ -173,9 +168,6 @@ def main(argv=None): ...@@ -173,9 +168,6 @@ def main(argv=None):
"file-output-related options.") "file-output-related options.")
parser.add_option("-s", "--source-dir", metavar="DIR", parser.add_option("-s", "--source-dir", metavar="DIR",
help="Use repository in the given directory.") help="Use repository in the given directory.")
parser.add_option("--git-hash-only", action="store_true",
help="In a Git repo with commit positions, report only " +
"the hash of the latest commit with a position.")
opts, args = parser.parse_args(argv[1:]) opts, args = parser.parse_args(argv[1:])
out_file = opts.output out_file = opts.output
...@@ -194,8 +186,7 @@ def main(argv=None): ...@@ -194,8 +186,7 @@ def main(argv=None):
else: else:
src_dir = os.path.dirname(os.path.abspath(__file__)) src_dir = os.path.dirname(os.path.abspath(__file__))
version_info = FetchVersionInfo(directory=src_dir, version_info = FetchVersionInfo(directory=src_dir)
hash_only=opts.git_hash_only)
if version_info.revision == None: if version_info.revision == None:
version_info.revision = '0' version_info.revision = '0'
......
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