Commit a1df57cd authored by Edward Lesmes's avatar Edward Lesmes Committed by Commit Bot

roll-dep: Support dictionaries in deps revisions.

Adds support for when the URL of the dependency is inside a dictionary.

R=agable@chromium.org

Bug: 760633
Change-Id: Idfdff0bdf27f0e3031f0cd17de2864da54ce65ac
Reviewed-on: https://chromium-review.googlesource.com/994416Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 1ad681ec
......@@ -10,6 +10,7 @@ script will always roll to the tip of to origin/master.
"""
import argparse
import collections
import gclient_eval
import os
import re
......@@ -127,7 +128,18 @@ 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.
"""
_, _, head = gclient_dict['deps'][dependency].partition('@')
if dependency not in gclient_dict['deps']:
raise Error('%s is not in the "deps" section of the DEPS file.')
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.')
if not head:
raise Error('%s is unpinned.' % dependency)
check_call(['git', 'fetch', 'origin', '--quiet'], cwd=full_dir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment