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

Side by Side Diff: build/util/lastchange.py

Issue 499063002: Temporarily make lastchange use only the git hash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also touch chrome_browser_main to try to force compile/tests Created 6 years, 4 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 | « no previous file | build/whitespace_file.txt » ('j') | chrome/browser/chrome_browser_main.cc » ('J')
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 A VersionInfo object or None on error. 100 A VersionInfo object or None on error.
101 """ 101 """
102 hsh = '' 102 hsh = ''
103 proc = RunGitCommand(directory, ['rev-parse', 'HEAD']) 103 proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
104 if proc: 104 if proc:
105 output = proc.communicate()[0].strip() 105 output = proc.communicate()[0].strip()
106 if proc.returncode == 0 and output: 106 if proc.returncode == 0 and output:
107 hsh = output 107 hsh = output
108 if not hsh: 108 if not hsh:
109 return None 109 return None
110 return VersionInfo('git', hsh)
111 # TODO(agable): Re-enable this code after the lastchange value can accept
112 # strings longer than 64 characters. See crbug.com/406783.
113 # The following code is unreachable.
Ryan Tseng 2014/08/23 18:39:32 We can just delete this? Or pylint will explode (o
agable 2014/08/23 18:42:36 Yeah I suppose I can delete the code and just rela
110 pos = '' 114 pos = ''
111 proc = RunGitCommand(directory, ['show', '-s', '--format=%B', 'HEAD']) 115 proc = RunGitCommand(directory, ['show', '-s', '--format=%B', 'HEAD'])
112 if proc: 116 if proc:
113 output = proc.communicate()[0] 117 output = proc.communicate()[0]
114 if proc.returncode == 0 and output: 118 if proc.returncode == 0 and output:
115 for line in reversed(output.splitlines()): 119 for line in reversed(output.splitlines()):
116 if line.startswith('Cr-Commit-Position:'): 120 if line.startswith('Cr-Commit-Position:'):
117 pos = line.rsplit()[-1].strip() 121 pos = line.rsplit()[-1].strip()
118 if not pos: 122 if not pos:
119 return VersionInfo('git', hsh) 123 return VersionInfo('git', hsh)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 if header: 294 if header:
291 WriteIfChanged(header, 295 WriteIfChanged(header,
292 GetHeaderContents(header, opts.version_macro, 296 GetHeaderContents(header, opts.version_macro,
293 version_info.revision)) 297 version_info.revision))
294 298
295 return 0 299 return 0
296 300
297 301
298 if __name__ == '__main__': 302 if __name__ == '__main__':
299 sys.exit(main()) 303 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/whitespace_file.txt » ('j') | chrome/browser/chrome_browser_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698