mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
roll-dep: Use gclient_eval.GetRevision to get current revision.
R=agable@chromium.org Bug: 760633 Change-Id: Iebabb417b5b1bd5a987de2707e84a0329e1ebe66 Reviewed-on: https://chromium-review.googlesource.com/1000758 Reviewed-by: Aaron Gable <agable@chromium.org> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
54a81e45dd
commit
58330b0db4
14
roll_dep.py
14
roll_dep.py
@@ -134,19 +134,7 @@ def calculate_roll(full_dir, dependency, gclient_dict, roll_to):
|
||||
"""Calculates the roll for a dependency by processing gclient_dict, and
|
||||
fetching the dependency via git.
|
||||
"""
|
||||
if dependency not in gclient_dict['deps']:
|
||||
raise Error(
|
||||
'%s is not in the "deps" section of the DEPS file.' % dependency)
|
||||
|
||||
head = None
|
||||
if isinstance(gclient_dict['deps'][dependency], basestring):
|
||||
_, _, head = gclient_dict['deps'][dependency].partition('@')
|
||||
elif (isinstance(gclient_dict['deps'][dependency], collections.Mapping)
|
||||
and 'url' in gclient_dict['deps'][dependency]):
|
||||
_, _, head = gclient_dict['deps'][dependency]['url'].partition('@')
|
||||
else:
|
||||
raise Error('%s is not a valid git dependency.' % dependency)
|
||||
|
||||
head = gclient_eval.GetRevision(gclient_dict, dependency)
|
||||
if not head:
|
||||
raise Error('%s is unpinned.' % dependency)
|
||||
check_call(['git', 'fetch', 'origin', '--quiet'], cwd=full_dir)
|
||||
|
||||
Reference in New Issue
Block a user