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

Side by Side Diff: tools/roll_webgl_conformance.py

Issue 2431383003: Don't let roll scripts use short hashes (Closed)
Patch Set: Created 4 years, 2 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 | « tools/roll_angle.py ('k') | tools/roll_webrtc.py » ('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 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 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 import argparse 6 import argparse
7 import collections 7 import collections
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if not ignore_exit_code and p.returncode != 0: 157 if not ignore_exit_code and p.returncode != 0:
158 logging.error('Command failed: %s\n%s', str(command), output) 158 logging.error('Command failed: %s\n%s', str(command), output)
159 sys.exit(p.returncode) 159 sys.exit(p.returncode)
160 return output 160 return output
161 161
162 def _GetCommitInfo(self, path_below_src, git_hash=None, git_repo_url=None): 162 def _GetCommitInfo(self, path_below_src, git_hash=None, git_repo_url=None):
163 working_dir = os.path.join(self._chromium_src, path_below_src) 163 working_dir = os.path.join(self._chromium_src, path_below_src)
164 self._RunCommand(['git', 'fetch', 'origin'], working_dir=working_dir) 164 self._RunCommand(['git', 'fetch', 'origin'], working_dir=working_dir)
165 revision_range = git_hash or 'origin' 165 revision_range = git_hash or 'origin'
166 ret = self._RunCommand( 166 ret = self._RunCommand(
167 ['git', '--no-pager', 'log', revision_range, '--pretty=full', '-1'], 167 ['git', '--no-pager', 'log', revision_range,
168 '--no-abbrev-commit', '--pretty=full', '-1'],
168 working_dir=working_dir) 169 working_dir=working_dir)
169 return CommitInfo(_ParseGitCommitHash(ret), git_repo_url) 170 return CommitInfo(_ParseGitCommitHash(ret), git_repo_url)
170 171
171 def _GetDepsCommitInfo(self, deps_dict, path_below_src): 172 def _GetDepsCommitInfo(self, deps_dict, path_below_src):
172 entry = deps_dict['deps'][_PosixPath('src/%s' % path_below_src)] 173 entry = deps_dict['deps'][_PosixPath('src/%s' % path_below_src)]
173 at_index = entry.find('@') 174 at_index = entry.find('@')
174 git_repo_url = entry[:at_index] 175 git_repo_url = entry[:at_index]
175 git_hash = entry[at_index + 1:] 176 git_hash = entry[at_index + 1:]
176 return self._GetCommitInfo(path_below_src, git_hash, git_repo_url) 177 return self._GetCommitInfo(path_below_src, git_hash, git_repo_url)
177 178
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 logging.basicConfig(level=logging.ERROR) 388 logging.basicConfig(level=logging.ERROR)
388 389
389 autoroller = AutoRoller(SRC_DIR) 390 autoroller = AutoRoller(SRC_DIR)
390 if args.abort: 391 if args.abort:
391 return autoroller.Abort() 392 return autoroller.Abort()
392 else: 393 else:
393 return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs) 394 return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs)
394 395
395 if __name__ == '__main__': 396 if __name__ == '__main__':
396 sys.exit(main()) 397 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/roll_angle.py ('k') | tools/roll_webrtc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698