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

Side by Side 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: rebase Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « build/util/BUILD.gn ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 lastchange.py -- Chromium revision fetching utility. 7 lastchange.py -- Chromium revision fetching utility.
8 """ 8 """
9 9
10 import re 10 import re
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 Errors are swallowed. 162 Errors are swallowed.
163 """ 163 """
164 url, revision = FetchGitSVNURLAndRevision(directory, svn_url_regex, go_deeper) 164 url, revision = FetchGitSVNURLAndRevision(directory, svn_url_regex, go_deeper)
165 if url and revision: 165 if url and revision:
166 return VersionInfo(url, revision) 166 return VersionInfo(url, revision)
167 return None 167 return None
168 168
169 169
170 def FetchVersionInfo(default_lastchange, directory=None, 170 def FetchVersionInfo(default_lastchange, directory=None,
171 directory_regex_prior_to_src_url='chrome|blink|svn', 171 directory_regex_prior_to_src_url='chrome|svn',
172 go_deeper=False, hash_only=False): 172 go_deeper=False, hash_only=False):
173 """ 173 """
174 Returns the last change (in the form of a branch, revision tuple), 174 Returns the last change (in the form of a branch, revision tuple),
175 from some appropriate revision control system. 175 from some appropriate revision control system.
176 """ 176 """
177 svn_url_regex = re.compile( 177 svn_url_regex = re.compile(
178 r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)') 178 r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
179 179
180 version_info = (FetchSVNRevision(directory, svn_url_regex) or 180 version_info = (FetchSVNRevision(directory, svn_url_regex) or
181 FetchGitSVNRevision(directory, svn_url_regex, go_deeper) or 181 FetchGitSVNRevision(directory, svn_url_regex, go_deeper) or
182 FetchGitRevision(directory, hash_only)) 182 FetchGitRevision(directory, hash_only))
Dirk Pranke 2016/05/17 20:08:33 Ideally we'd get rid of all of the SVN and Git+SVN
183 if not version_info: 183 if not version_info:
184 if default_lastchange and os.path.exists(default_lastchange): 184 if default_lastchange and os.path.exists(default_lastchange):
185 revision = open(default_lastchange, 'r').read().strip() 185 revision = open(default_lastchange, 'r').read().strip()
186 version_info = VersionInfo(None, revision) 186 version_info = VersionInfo(None, revision)
187 else: 187 else:
188 version_info = VersionInfo(None, None) 188 version_info = VersionInfo(None, None)
189 return version_info 189 return version_info
190 190
191 def GetHeaderGuard(path): 191 def GetHeaderGuard(path):
192 """ 192 """
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if header: 307 if header:
308 WriteIfChanged(header, 308 WriteIfChanged(header,
309 GetHeaderContents(header, opts.version_macro, 309 GetHeaderContents(header, opts.version_macro,
310 version_info.revision)) 310 version_info.revision))
311 311
312 return 0 312 return 0
313 313
314 314
315 if __name__ == '__main__': 315 if __name__ == '__main__':
316 sys.exit(main()) 316 sys.exit(main())
OLDNEW
« no previous file with comments | « build/util/BUILD.gn ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698