Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1329)

Unified Diff: build/util/lastchange.py

Issue 1982423002: Get rid of LASTCHANGE.blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try to fix devtools Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/util/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index df4eeabed1a204fb9105f39d2230d10e50f370d3..3324f31466b7538946c49d498c79af8c2f5cae50 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -48,7 +48,7 @@ def RunGitCommand(directory, command):
return None
-def FetchGitRevision(directory, hash_only):
+def FetchGitRevision(directory):
"""
Fetch the Git hash for a given directory.
@@ -59,8 +59,6 @@ def FetchGitRevision(directory, hash_only):
"""
hsh = ''
git_args = ['log', '-1', '--format=%H']
- if hash_only:
- git_args.append('--grep=^Cr-Commit-Position:')
proc = RunGitCommand(directory, git_args)
if proc:
output = proc.communicate()[0].strip()
@@ -77,14 +75,11 @@ def FetchGitRevision(directory, hash_only):
if line.startswith('Cr-Commit-Position:'):
pos = line.rsplit()[-1].strip()
break
- if hash_only or not pos:
- return VersionInfo('git', hsh)
return VersionInfo('git', '%s-%s' % (hsh, pos))
def FetchVersionInfo(directory=None,
- directory_regex_prior_to_src_url='chrome|blink|svn',
- hash_only=False):
+ directory_regex_prior_to_src_url='chrome|svn'):
"""
Returns the last change (in the form of a branch, revision tuple),
from some appropriate revision control system.
@@ -92,7 +87,7 @@ def FetchVersionInfo(directory=None,
svn_url_regex = re.compile(
r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
- version_info = FetchGitRevision(directory, hash_only)
+ version_info = FetchGitRevision(directory)
if not version_info:
version_info = VersionInfo(None, None)
return version_info
@@ -173,9 +168,6 @@ def main(argv=None):
"file-output-related options.")
parser.add_option("-s", "--source-dir", metavar="DIR",
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:])
out_file = opts.output
@@ -194,8 +186,7 @@ def main(argv=None):
else:
src_dir = os.path.dirname(os.path.abspath(__file__))
- version_info = FetchVersionInfo(directory=src_dir,
- hash_only=opts.git_hash_only)
+ version_info = FetchVersionInfo(directory=src_dir)
if version_info.revision == None:
version_info.revision = '0'
« no previous file with comments | « build/util/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698