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

Side by Side Diff: tools/roll_webrtc.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_webgl_conformance.py ('k') | no next file » | 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 git_log, 213 git_log,
214 EXTRA_TRYBOTS) 214 EXTRA_TRYBOTS)
215 215
216 return description 216 return description
217 217
218 def _GetCommitInfo(self, path_below_src, git_hash=None, git_repo_url=None): 218 def _GetCommitInfo(self, path_below_src, git_hash=None, git_repo_url=None):
219 working_dir = os.path.join(self._chromium_src, path_below_src) 219 working_dir = os.path.join(self._chromium_src, path_below_src)
220 self._RunCommand(['git', 'fetch', 'origin'], working_dir=working_dir) 220 self._RunCommand(['git', 'fetch', 'origin'], working_dir=working_dir)
221 revision_range = git_hash or 'origin' 221 revision_range = git_hash or 'origin'
222 ret = self._RunCommand( 222 ret = self._RunCommand(
223 ['git', '--no-pager', 'log', revision_range, '--pretty=full', '-1'], 223 ['git', '--no-pager', 'log', revision_range,
224 '--no-abbrev-commit', '--pretty=full', '-1'],
224 working_dir=working_dir) 225 working_dir=working_dir)
225 return CommitInfo(_ParseGitCommitPosition(ret), _ParseGitCommitHash(ret), 226 return CommitInfo(_ParseGitCommitPosition(ret), _ParseGitCommitHash(ret),
226 git_repo_url) 227 git_repo_url)
227 228
228 def _GetDepsCommitInfo(self, deps_dict, path_below_src): 229 def _GetDepsCommitInfo(self, deps_dict, path_below_src):
229 entry = deps_dict['deps'][_PosixPath('src/%s' % path_below_src)] 230 entry = deps_dict['deps'][_PosixPath('src/%s' % path_below_src)]
230 at_index = entry.find('@') 231 at_index = entry.find('@')
231 git_repo_url = entry[:at_index] 232 git_repo_url = entry[:at_index]
232 git_hash = entry[at_index + 1:] 233 git_hash = entry[at_index + 1:]
233 return self._GetCommitInfo(path_below_src, git_hash, git_repo_url) 234 return self._GetCommitInfo(path_below_src, git_hash, git_repo_url)
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if args.abort: 429 if args.abort:
429 return autoroller.Abort() 430 return autoroller.Abort()
430 elif args.wait_for_trybots: 431 elif args.wait_for_trybots:
431 return autoroller.WaitForTrybots() 432 return autoroller.WaitForTrybots()
432 else: 433 else:
433 return autoroller.PrepareRoll(args.dry_run, args.ignore_checks, 434 return autoroller.PrepareRoll(args.dry_run, args.ignore_checks,
434 args.no_commit, args.close_previous_roll) 435 args.no_commit, args.close_previous_roll)
435 436
436 if __name__ == '__main__': 437 if __name__ == '__main__':
437 sys.exit(main()) 438 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/roll_webgl_conformance.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698