Commit b9907703 authored by John Budorick's avatar John Budorick Committed by Commit Bot

Revert "Reland "Expand variables in gclient flattened output.""

This reverts commit ff622244.

Reason for revert: spec revert for crbug.com/849374

Original change's description:
> Reland "Expand variables in gclient flattened output."
> 
> This is a reland of a32f98e6
> 
> Original change's description:
> > Expand variables in gclient flattened output.
> >
> > Bug: 848990
> > Change-Id: I0ad7e4f965973edbc5a335bd30f9cbd7b04abff2
> > Reviewed-on: https://chromium-review.googlesource.com/1085996
> > Reviewed-by: Michael Moss <mmoss@chromium.org>
> > Reviewed-by: Aaron Gable <agable@chromium.org>
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> 
> Tbr: agable@chromium.org
> Bug: 848990
> Change-Id: I7843544b79b2ab7e2046c187d13ea3eb65fc1b7d
> Reviewed-on: https://chromium-review.googlesource.com/1085975
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=agable@chromium.org,mmoss@chromium.org,ehmaldonado@chromium.org

Change-Id: I89ffb80893be72f60043e8a6e02f6c0fb6fe5cc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 848990
Reviewed-on: https://chromium-review.googlesource.com/1086747Reviewed-by: 's avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
parent ff622244
...@@ -207,7 +207,7 @@ class Hook(object): ...@@ -207,7 +207,7 @@ class Hook(object):
not gclient_eval.EvaluateCondition(self._condition, self._variables)): not gclient_eval.EvaluateCondition(self._condition, self._variables)):
return return
cmd = [arg for arg in self._action] cmd = [arg.format(**self._variables) for arg in self._action]
if cmd[0] == 'python': if cmd[0] == 'python':
# If the hook specified "python" as the first item, the action is a # If the hook specified "python" as the first item, the action is a
...@@ -240,11 +240,12 @@ class Hook(object): ...@@ -240,11 +240,12 @@ class Hook(object):
class DependencySettings(object): class DependencySettings(object):
"""Immutable configuration settings.""" """Immutable configuration settings."""
def __init__( def __init__(
self, parent, url, managed, custom_deps, custom_vars, self, parent, raw_url, url, managed, custom_deps, custom_vars,
custom_hooks, deps_file, should_process, relative, condition): custom_hooks, deps_file, should_process, relative, condition):
# These are not mutable: # These are not mutable:
self._parent = parent self._parent = parent
self._deps_file = deps_file self._deps_file = deps_file
self._raw_url = raw_url
self._url = url self._url = url
# The condition as string (or None). Useful to keep e.g. for flatten. # The condition as string (or None). Useful to keep e.g. for flatten.
self._condition = condition self._condition = condition
...@@ -322,6 +323,11 @@ class DependencySettings(object): ...@@ -322,6 +323,11 @@ class DependencySettings(object):
def custom_hooks(self): def custom_hooks(self):
return self._custom_hooks[:] return self._custom_hooks[:]
@property
def raw_url(self):
"""URL before variable expansion."""
return self._raw_url
@property @property
def url(self): def url(self):
"""URL after variable expansion.""" """URL after variable expansion."""
...@@ -345,6 +351,9 @@ class DependencySettings(object): ...@@ -345,6 +351,9 @@ class DependencySettings(object):
def set_url(self, url): def set_url(self, url):
self._url = url self._url = url
def set_raw_url(self, url):
self._raw_url = url
def get_custom_deps(self, name, url): def get_custom_deps(self, name, url):
"""Returns a custom deps if applicable.""" """Returns a custom deps if applicable."""
if self.parent: if self.parent:
...@@ -356,12 +365,12 @@ class DependencySettings(object): ...@@ -356,12 +365,12 @@ class DependencySettings(object):
class Dependency(gclient_utils.WorkItem, DependencySettings): class Dependency(gclient_utils.WorkItem, DependencySettings):
"""Object that represents a dependency checkout.""" """Object that represents a dependency checkout."""
def __init__(self, parent, name, url, managed, custom_deps, def __init__(self, parent, name, raw_url, url, managed, custom_deps,
custom_vars, custom_hooks, deps_file, should_process, custom_vars, custom_hooks, deps_file, should_process,
relative, condition, print_outbuf=False): relative, condition, print_outbuf=False):
gclient_utils.WorkItem.__init__(self, name) gclient_utils.WorkItem.__init__(self, name)
DependencySettings.__init__( DependencySettings.__init__(
self, parent, url, managed, custom_deps, custom_vars, self, parent, raw_url, url, managed, custom_deps, custom_vars,
custom_hooks, deps_file, should_process, relative, condition) custom_hooks, deps_file, should_process, relative, condition)
# This is in both .gclient and DEPS files: # This is in both .gclient and DEPS files:
...@@ -459,15 +468,18 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -459,15 +468,18 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
raise gclient_utils.Error('Unknown url type') raise gclient_utils.Error('Unknown url type')
def PinToActualRevision(self): def PinToActualRevision(self):
"""Updates self.url to the revision checked out on disk.""" """Updates self.url and self.raw_url to the revision checked out on disk."""
if self.url is None: if self.url is None:
return return
url = None url = raw_url = None
scm = self.CreateSCM() scm = self.CreateSCM()
if os.path.isdir(scm.checkout_path): if os.path.isdir(scm.checkout_path):
revision = scm.revinfo(None, None, None) revision = scm.revinfo(None, None, None)
url = '%s@%s' % (gclient_utils.SplitUrlRevision(self.url)[0], revision) url = '%s@%s' % (gclient_utils.SplitUrlRevision(self.url)[0], revision)
raw_url = '%s@%s' % (
gclient_utils.SplitUrlRevision(self.raw_url)[0], revision)
self.set_url(url) self.set_url(url)
self.set_raw_url(raw_url)
def ToLines(self): def ToLines(self):
s = [] s = []
...@@ -476,7 +488,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -476,7 +488,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
s.extend([ s.extend([
' # %s' % self.hierarchy(include_url=False), ' # %s' % self.hierarchy(include_url=False),
' "%s": {' % (self.name,), ' "%s": {' % (self.name,),
' "url": "%s",' % (self.url,), ' "url": "%s",' % (self.raw_url,),
] + condition_part + [ ] + condition_part + [
' },', ' },',
'', '',
...@@ -630,23 +642,25 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -630,23 +642,25 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
for package in dep_value.get('packages', []): for package in dep_value.get('packages', []):
if 'version' in package: if 'version' in package:
# Matches version to vars value. # Matches version to vars value.
version = package['version'] raw_version = package['version']
version = raw_version.format(**self.get_vars())
package['version'] = version package['version'] = version
deps_to_add.append( deps_to_add.append(
CipdDependency( CipdDependency(
self, name, package, cipd_root, self.custom_vars, self, name, package, cipd_root, self.custom_vars,
should_process, use_relative_paths, condition)) should_process, use_relative_paths, condition))
else: else:
url = dep_value.get('url') raw_url = dep_value.get('url')
url = raw_url.format(**self.get_vars()) if raw_url else None
deps_to_add.append( deps_to_add.append(
GitDependency( GitDependency(
self, name, url, None, None, self.custom_vars, None, self, name, raw_url, url, None, None, self.custom_vars, None,
deps_file, should_process, use_relative_paths, condition)) deps_file, should_process, use_relative_paths, condition))
deps_to_add.sort(key=lambda x: x.name) deps_to_add.sort(key=lambda x: x.name)
return deps_to_add return deps_to_add
def ParseDepsFile(self): def ParseDepsFile(self, expand_vars=True):
"""Parses the DEPS file for this dependency.""" """Parses the DEPS file for this dependency."""
assert not self.deps_parsed assert not self.deps_parsed
assert not self.dependencies assert not self.dependencies
...@@ -677,7 +691,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -677,7 +691,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
if deps_content: if deps_content:
try: try:
local_scope = gclient_eval.Parse( local_scope = gclient_eval.Parse(
deps_content, self._get_option('validate_syntax', False), deps_content, expand_vars,
self._get_option('validate_syntax', False),
filepath, self.get_vars()) filepath, self.get_vars())
except SyntaxError as e: except SyntaxError as e:
gclient_utils.SyntaxErrorToError(filepath, e) gclient_utils.SyntaxErrorToError(filepath, e)
...@@ -900,7 +915,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -900,7 +915,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
file_list[i] = file_list[i][1:] file_list[i] = file_list[i][1:]
if self.recursion_limit: if self.recursion_limit:
self.ParseDepsFile() self.ParseDepsFile(expand_vars=(command != 'flatten'))
self._run_is_done(file_list or []) self._run_is_done(file_list or [])
...@@ -1279,7 +1294,7 @@ solutions = %(solution_list)s ...@@ -1279,7 +1294,7 @@ solutions = %(solution_list)s
# Do not change previous behavior. Only solution level and immediate DEPS # Do not change previous behavior. Only solution level and immediate DEPS
# are processed. # are processed.
self._recursion_limit = 2 self._recursion_limit = 2
GitDependency.__init__(self, None, None, None, True, None, None, None, GitDependency.__init__(self, None, None, None, None, True, None, None, None,
'unused', True, None, None, True) 'unused', True, None, None, True)
self._options = options self._options = options
if options.deps_os: if options.deps_os:
...@@ -1371,7 +1386,7 @@ it or fix the checkout. ...@@ -1371,7 +1386,7 @@ it or fix the checkout.
for s in config_dict.get('solutions', []): for s in config_dict.get('solutions', []):
try: try:
deps_to_add.append(GitDependency( deps_to_add.append(GitDependency(
self, s['name'], s['url'], self, s['name'], s['url'], s['url'],
s.get('managed', True), s.get('managed', True),
s.get('custom_deps', {}), s.get('custom_deps', {}),
s.get('custom_vars', {}), s.get('custom_vars', {}),
...@@ -1738,7 +1753,7 @@ it or fix the checkout. ...@@ -1738,7 +1753,7 @@ it or fix the checkout.
print('%s: %s' % (x, entries[x])) print('%s: %s' % (x, entries[x]))
logging.info(str(self)) logging.info(str(self))
def ParseDepsFile(self): def ParseDepsFile(self, expand_vars=None):
"""No DEPS to parse for a .gclient file.""" """No DEPS to parse for a .gclient file."""
raise gclient_utils.Error('Internal error') raise gclient_utils.Error('Internal error')
...@@ -1831,7 +1846,7 @@ class CipdDependency(Dependency): ...@@ -1831,7 +1846,7 @@ class CipdDependency(Dependency):
self._cipd_package = self._cipd_root.add_package( self._cipd_package = self._cipd_root.add_package(
self._cipd_subdir, self._package_name, self._package_version) self._cipd_subdir, self._package_name, self._package_version)
def ParseDepsFile(self): def ParseDepsFile(self, expand_vars=None):
"""CIPD dependencies are not currently allowed to have nested deps.""" """CIPD dependencies are not currently allowed to have nested deps."""
self.add_dependencies_and_close([], []) self.add_dependencies_and_close([], [])
...@@ -2181,7 +2196,7 @@ def _DepsOsToLines(deps_os): ...@@ -2181,7 +2196,7 @@ def _DepsOsToLines(deps_os):
s.extend([ s.extend([
' # %s' % dep.hierarchy(include_url=False), ' # %s' % dep.hierarchy(include_url=False),
' "%s": {' % (name,), ' "%s": {' % (name,),
' "url": "%s",' % (dep.url,), ' "url": "%s",' % (dep.raw_url,),
] + condition_part + [ ] + condition_part + [
' },', ' },',
'', '',
...@@ -2713,7 +2728,8 @@ def CMDgetdep(parser, args): ...@@ -2713,7 +2728,8 @@ def CMDgetdep(parser, args):
'DEPS file %s does not exist.' % options.deps_file) 'DEPS file %s does not exist.' % options.deps_file)
with open(options.deps_file) as f: with open(options.deps_file) as f:
contents = f.read() contents = f.read()
local_scope = gclient_eval.Exec(contents, options.deps_file) local_scope = gclient_eval.Exec(
contents, expand_vars=True, filename=options.deps_file)
for var in options.vars: for var in options.vars:
print(gclient_eval.GetVar(local_scope, var)) print(gclient_eval.GetVar(local_scope, var))
...@@ -2762,7 +2778,8 @@ def CMDsetdep(parser, args): ...@@ -2762,7 +2778,8 @@ def CMDsetdep(parser, args):
'DEPS file %s does not exist.' % options.deps_file) 'DEPS file %s does not exist.' % options.deps_file)
with open(options.deps_file) as f: with open(options.deps_file) as f:
contents = f.read() contents = f.read()
local_scope = gclient_eval.Exec(contents, options.deps_file) local_scope = gclient_eval.Exec(
contents, expand_vars=True, filename=options.deps_file)
for var in options.vars: for var in options.vars:
name, _, value = var.partition('=') name, _, value = var.partition('=')
......
...@@ -206,7 +206,8 @@ _GCLIENT_SCHEMA = schema.Schema(_NodeDictSchema({ ...@@ -206,7 +206,8 @@ _GCLIENT_SCHEMA = schema.Schema(_NodeDictSchema({
})) }))
def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None): def _gclient_eval(node_or_string, vars_dict=None, expand_vars=False,
filename='<unknown>'):
"""Safely evaluates a single expression. Returns the result.""" """Safely evaluates a single expression. Returns the result."""
_allowed_names = {'None': None, 'True': True, 'False': False} _allowed_names = {'None': None, 'True': True, 'False': False}
if isinstance(node_or_string, basestring): if isinstance(node_or_string, basestring):
...@@ -215,12 +216,12 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None): ...@@ -215,12 +216,12 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None):
node_or_string = node_or_string.body node_or_string = node_or_string.body
def _convert(node): def _convert(node):
if isinstance(node, ast.Str): if isinstance(node, ast.Str):
if vars_dict is None: if not expand_vars:
return node.s return node.s
try: try:
return node.s.format(**vars_dict) return node.s.format(**vars_dict)
except KeyError as e: except KeyError as e:
raise KeyError( raise ValueError(
'%s was used as a variable, but was not declared in the vars dict ' '%s was used as a variable, but was not declared in the vars dict '
'(file %r, line %s)' % ( '(file %r, line %s)' % (
e.message, filename, getattr(node, 'lineno', '<unknown>'))) e.message, filename, getattr(node, 'lineno', '<unknown>')))
...@@ -253,10 +254,14 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None): ...@@ -253,10 +254,14 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None):
raise ValueError( raise ValueError(
'Var\'s argument must be a variable name (file %r, line %s)' % ( 'Var\'s argument must be a variable name (file %r, line %s)' % (
filename, getattr(node, 'lineno', '<unknown>'))) filename, getattr(node, 'lineno', '<unknown>')))
if not expand_vars:
return '{%s}' % arg
if vars_dict is None: if vars_dict is None:
return '{' + arg + '}' raise ValueError(
'vars must be declared before Var can be used (file %r, line %s)'
% (filename, getattr(node, 'lineno', '<unknown>')))
if arg not in vars_dict: if arg not in vars_dict:
raise KeyError( raise ValueError(
'%s was used as a variable, but was not declared in the vars dict ' '%s was used as a variable, but was not declared in the vars dict '
'(file %r, line %s)' % ( '(file %r, line %s)' % (
arg, filename, getattr(node, 'lineno', '<unknown>'))) arg, filename, getattr(node, 'lineno', '<unknown>')))
...@@ -273,7 +278,7 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None): ...@@ -273,7 +278,7 @@ def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None):
return _convert(node_or_string) return _convert(node_or_string)
def Exec(content, filename='<unknown>', vars_override=None): def Exec(content, expand_vars=True, filename='<unknown>', vars_override=None):
"""Safely execs a set of assignments.""" """Safely execs a set of assignments."""
def _validate_statement(node, local_scope): def _validate_statement(node, local_scope):
if not isinstance(node, ast.Assign): if not isinstance(node, ast.Assign):
...@@ -325,7 +330,7 @@ def Exec(content, filename='<unknown>', vars_override=None): ...@@ -325,7 +330,7 @@ def Exec(content, filename='<unknown>', vars_override=None):
vars_dict = {} vars_dict = {}
if 'vars' in statements: if 'vars' in statements:
vars_statement = statements['vars'] vars_statement = statements['vars']
value = _gclient_eval(vars_statement, filename) value = _gclient_eval(vars_statement, None, False, filename)
local_scope.SetNode('vars', value, vars_statement) local_scope.SetNode('vars', value, vars_statement)
# Update the parsed vars with the overrides, but only if they are already # Update the parsed vars with the overrides, but only if they are already
# present (overrides do not introduce new variables). # present (overrides do not introduce new variables).
...@@ -337,13 +342,14 @@ def Exec(content, filename='<unknown>', vars_override=None): ...@@ -337,13 +342,14 @@ def Exec(content, filename='<unknown>', vars_override=None):
if k in vars_dict}) if k in vars_dict})
for name, node in statements.iteritems(): for name, node in statements.iteritems():
value = _gclient_eval(node, filename, vars_dict) value = _gclient_eval(node, vars_dict, expand_vars, filename)
local_scope.SetNode(name, value, node) local_scope.SetNode(name, value, node)
return _GCLIENT_SCHEMA.validate(local_scope) return _GCLIENT_SCHEMA.validate(local_scope)
def ExecLegacy(content, filename='<unknown>', vars_override=None): def ExecLegacy(content, expand_vars=True, filename='<unknown>',
vars_override=None):
"""Executes a DEPS file |content| using exec.""" """Executes a DEPS file |content| using exec."""
local_scope = {} local_scope = {}
global_scope = {'Var': lambda var_name: '{%s}' % var_name} global_scope = {'Var': lambda var_name: '{%s}' % var_name}
...@@ -354,7 +360,7 @@ def ExecLegacy(content, filename='<unknown>', vars_override=None): ...@@ -354,7 +360,7 @@ def ExecLegacy(content, filename='<unknown>', vars_override=None):
# as "exec a in b, c" (See https://bugs.python.org/issue21591). # as "exec a in b, c" (See https://bugs.python.org/issue21591).
eval(compile(content, filename, 'exec'), global_scope, local_scope) eval(compile(content, filename, 'exec'), global_scope, local_scope)
if 'vars' not in local_scope: if 'vars' not in local_scope or not expand_vars:
return local_scope return local_scope
vars_dict = {} vars_dict = {}
...@@ -449,7 +455,7 @@ def UpdateCondition(info_dict, op, new_condition): ...@@ -449,7 +455,7 @@ def UpdateCondition(info_dict, op, new_condition):
del info_dict['condition'] del info_dict['condition']
def Parse(content, validate_syntax, filename, vars_override=None): def Parse(content, expand_vars, validate_syntax, filename, vars_override=None):
"""Parses DEPS strings. """Parses DEPS strings.
Executes the Python-like string stored in content, resulting in a Python Executes the Python-like string stored in content, resulting in a Python
...@@ -458,6 +464,7 @@ def Parse(content, validate_syntax, filename, vars_override=None): ...@@ -458,6 +464,7 @@ def Parse(content, validate_syntax, filename, vars_override=None):
Args: Args:
content: str. DEPS file stored as a string. content: str. DEPS file stored as a string.
expand_vars: bool. Whether variables should be expanded to their values.
validate_syntax: bool. Whether syntax should be validated using the schema validate_syntax: bool. Whether syntax should be validated using the schema
defined above. defined above.
filename: str. The name of the DEPS file, or a string describing the source filename: str. The name of the DEPS file, or a string describing the source
...@@ -470,9 +477,9 @@ def Parse(content, validate_syntax, filename, vars_override=None): ...@@ -470,9 +477,9 @@ def Parse(content, validate_syntax, filename, vars_override=None):
schema above. schema above.
""" """
if validate_syntax: if validate_syntax:
result = Exec(content, filename, vars_override) result = Exec(content, expand_vars, filename, vars_override)
else: else:
result = ExecLegacy(content, filename, vars_override) result = ExecLegacy(content, expand_vars, filename, vars_override)
vars_dict = result.get('vars', {}) vars_dict = result.get('vars', {})
if 'deps' in result: if 'deps' in result:
......
...@@ -9,4 +9,4 @@ As the CI needs of the browser grew, Batty, the Build and Test Yeti, got ...@@ -9,4 +9,4 @@ As the CI needs of the browser grew, Batty, the Build and Test Yeti, got
a new friend: a new friend:
The End. The End!
...@@ -225,7 +225,7 @@ def main(): ...@@ -225,7 +225,7 @@ def main():
# First gather all the information without modifying anything, except for a # First gather all the information without modifying anything, except for a
# git fetch. # git fetch.
deps_path, deps_content = get_deps(current_dir) deps_path, deps_content = get_deps(current_dir)
gclient_dict = gclient_eval.Exec(deps_content, deps_path) gclient_dict = gclient_eval.Exec(deps_content, True, deps_path)
is_relative = gclient_dict.get('use_relative_paths', False) is_relative = gclient_dict.get('use_relative_paths', False)
root_dir = current_dir if is_relative else gclient_root root_dir = current_dir if is_relative else gclient_root
rolls = {} rolls = {}
......
...@@ -44,19 +44,22 @@ class GClientEvalTest(unittest.TestCase): ...@@ -44,19 +44,22 @@ class GClientEvalTest(unittest.TestCase):
gclient_eval._gclient_eval('Foo("bar")') gclient_eval._gclient_eval('Foo("bar")')
self.assertIn('Var is the only allowed function', str(cm.exception)) self.assertIn('Var is the only allowed function', str(cm.exception))
def test_call(self):
self.assertEqual('{bar}', gclient_eval._gclient_eval('Var("bar")'))
def test_expands_vars(self): def test_expands_vars(self):
self.assertEqual( self.assertEqual(
'foo', 'foo',
gclient_eval._gclient_eval('Var("bar")', vars_dict={'bar': 'foo'})) gclient_eval._gclient_eval('Var("bar")', {'bar': 'foo'}, True))
def test_expands_vars_with_braces(self): def test_expands_vars_with_braces(self):
self.assertEqual( self.assertEqual(
'foo', 'foo',
gclient_eval._gclient_eval('"{bar}"', vars_dict={'bar': 'foo'})) gclient_eval._gclient_eval('"{bar}"', {'bar': 'foo'}, True))
def test_invalid_var(self): def test_invalid_var(self):
with self.assertRaises(KeyError) as cm: with self.assertRaises(ValueError) as cm:
gclient_eval._gclient_eval('"{bar}"', vars_dict={}) gclient_eval._gclient_eval('"{bar}"', {}, True)
self.assertIn('bar was used as a variable, but was not declared', self.assertIn('bar was used as a variable, but was not declared',
str(cm.exception)) str(cm.exception))
...@@ -137,6 +140,20 @@ class ExecTest(unittest.TestCase): ...@@ -137,6 +140,20 @@ class ExecTest(unittest.TestCase):
'deps': collections.OrderedDict([('a_dep', 'abarb')]), 'deps': collections.OrderedDict([('a_dep', 'abarb')]),
}, local_scope) }, local_scope)
def test_var_unexpanded(self):
local_scope = gclient_eval.Exec('\n'.join([
'vars = {',
' "foo": "bar",',
'}',
'deps = {',
' "a_dep": "a" + Var("foo") + "b",',
'}',
]), False)
self.assertEqual({
'vars': collections.OrderedDict([('foo', 'bar')]),
'deps': collections.OrderedDict([('a_dep', 'a{foo}b')]),
}, local_scope)
def test_empty_deps(self): def test_empty_deps(self):
local_scope = gclient_eval.Exec('deps = {}') local_scope = gclient_eval.Exec('deps = {}')
self.assertEqual({'deps': {}}, local_scope) self.assertEqual({'deps': {}}, local_scope)
...@@ -149,14 +166,14 @@ class ExecTest(unittest.TestCase): ...@@ -149,14 +166,14 @@ class ExecTest(unittest.TestCase):
'deps = {', 'deps = {',
' "a_dep": "a{foo}b",', ' "a_dep": "a{foo}b",',
'}', '}',
]), vars_override={'foo': 'baz'}) ]), True, vars_override={'foo': 'baz'})
self.assertEqual({ self.assertEqual({
'vars': collections.OrderedDict([('foo', 'bar')]), 'vars': collections.OrderedDict([('foo', 'bar')]),
'deps': collections.OrderedDict([('a_dep', 'abazb')]), 'deps': collections.OrderedDict([('a_dep', 'abazb')]),
}, local_scope) }, local_scope)
def test_doesnt_override_undeclared_vars(self): def test_doesnt_override_undeclared_vars(self):
with self.assertRaises(KeyError) as cm: with self.assertRaises(ValueError) as cm:
gclient_eval.Exec('\n'.join([ gclient_eval.Exec('\n'.join([
'vars = {', 'vars = {',
' "foo": "bar",', ' "foo": "bar",',
...@@ -164,7 +181,7 @@ class ExecTest(unittest.TestCase): ...@@ -164,7 +181,7 @@ class ExecTest(unittest.TestCase):
'deps = {', 'deps = {',
' "a_dep": "a{baz}b",', ' "a_dep": "a{baz}b",',
'}', '}',
]), vars_override={'baz': 'lalala'}) ]), True, vars_override={'baz': 'lalala'})
self.assertIn('baz was used as a variable, but was not declared', self.assertIn('baz was used as a variable, but was not declared',
str(cm.exception)) str(cm.exception))
...@@ -584,7 +601,8 @@ class RevisionTest(unittest.TestCase): ...@@ -584,7 +601,8 @@ class RevisionTest(unittest.TestCase):
class ParseTest(unittest.TestCase): class ParseTest(unittest.TestCase):
def callParse(self, validate_syntax=True, vars_override=None): def callParse(self, expand_vars=True, validate_syntax=True,
vars_override=None):
return gclient_eval.Parse('\n'.join([ return gclient_eval.Parse('\n'.join([
'vars = {', 'vars = {',
' "foo": "bar",', ' "foo": "bar",',
...@@ -592,32 +610,7 @@ class ParseTest(unittest.TestCase): ...@@ -592,32 +610,7 @@ class ParseTest(unittest.TestCase):
'deps = {', 'deps = {',
' "a_dep": "a{foo}b",', ' "a_dep": "a{foo}b",',
'}', '}',
]), validate_syntax, '<unknown>', vars_override) ]), expand_vars, validate_syntax, '<unknown>', vars_override)
def test_supports_vars_inside_vars(self):
deps_file = '\n'.join([
'vars = {',
' "foo": "bar",',
' "baz": "\\"{foo}\\" == \\"bar\\"",',
'}',
'deps = {',
' "src/baz": {',
' "url": "baz_url",',
' "condition": "baz",',
' },',
'}',
])
for validate_syntax in False, True:
local_scope = gclient_eval.Parse(
deps_file, validate_syntax, '<unknown>', None)
self.assertEqual({
'vars': {'foo': 'bar',
'baz': '"bar" == "bar"'},
'deps': {'src/baz': {'url': 'baz_url',
'dep_type': 'git',
'condition': 'baz'}},
}, local_scope)
def test_expands_vars(self): def test_expands_vars(self):
for validate_syntax in True, False: for validate_syntax in True, False:
...@@ -628,6 +621,16 @@ class ParseTest(unittest.TestCase): ...@@ -628,6 +621,16 @@ class ParseTest(unittest.TestCase):
'dep_type': 'git'}}, 'dep_type': 'git'}},
}, local_scope) }, local_scope)
def test_no_expands_vars(self):
for validate_syntax in True, False:
local_scope = self.callParse(False,
validate_syntax=validate_syntax)
self.assertEqual({
'vars': {'foo': 'bar'},
'deps': {'a_dep': {'url': 'a{foo}b',
'dep_type': 'git'}},
}, local_scope)
def test_overrides_vars(self): def test_overrides_vars(self):
for validate_syntax in True, False: for validate_syntax in True, False:
local_scope = self.callParse(validate_syntax=validate_syntax, local_scope = self.callParse(validate_syntax=validate_syntax,
...@@ -648,15 +651,17 @@ class ParseTest(unittest.TestCase): ...@@ -648,15 +651,17 @@ class ParseTest(unittest.TestCase):
'}', '}',
]) ])
with self.assertRaises(KeyError) as cm: with self.assertRaises(ValueError) as cm:
gclient_eval.Parse( gclient_eval.Parse(
deps_file, True, '<unknown>', {'baz': 'lalala'}) deps_file, True, True,
'<unknown>', {'baz': 'lalala'})
self.assertIn('baz was used as a variable, but was not declared', self.assertIn('baz was used as a variable, but was not declared',
str(cm.exception)) str(cm.exception))
with self.assertRaises(KeyError) as cm: with self.assertRaises(KeyError) as cm:
gclient_eval.Parse( gclient_eval.Parse(
deps_file, False, '<unknown>', {'baz': 'lalala'}) deps_file, True, False,
'<unknown>', {'baz': 'lalala'})
self.assertIn('baz', str(cm.exception)) self.assertIn('baz', str(cm.exception))
def test_standardizes_deps_string_dep(self): def test_standardizes_deps_string_dep(self):
...@@ -665,7 +670,7 @@ class ParseTest(unittest.TestCase): ...@@ -665,7 +670,7 @@ class ParseTest(unittest.TestCase):
'deps = {', 'deps = {',
' "a_dep": "a_url@a_rev",', ' "a_dep": "a_url@a_rev",',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': {'a_dep': {'url': 'a_url@a_rev', 'deps': {'a_dep': {'url': 'a_url@a_rev',
'dep_type': 'git'}}, 'dep_type': 'git'}},
...@@ -680,7 +685,7 @@ class ParseTest(unittest.TestCase): ...@@ -680,7 +685,7 @@ class ParseTest(unittest.TestCase):
' "condition": "checkout_android",', ' "condition": "checkout_android",',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': {'a_dep': {'url': 'a_url@a_rev', 'deps': {'a_dep': {'url': 'a_url@a_rev',
'dep_type': 'git', 'dep_type': 'git',
...@@ -698,7 +703,7 @@ class ParseTest(unittest.TestCase): ...@@ -698,7 +703,7 @@ class ParseTest(unittest.TestCase):
' "a_dep": None,', ' "a_dep": None,',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': {'a_dep': {'url': 'a_url@a_rev', 'deps': {'a_dep': {'url': 'a_url@a_rev',
'dep_type': 'git'}}, 'dep_type': 'git'}},
...@@ -715,7 +720,7 @@ class ParseTest(unittest.TestCase): ...@@ -715,7 +720,7 @@ class ParseTest(unittest.TestCase):
' "b_dep": "b_url@b_rev"', ' "b_dep": "b_url@b_rev"',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': {'a_dep': {'url': 'a_url@a_rev', 'deps': {'a_dep': {'url': 'a_url@a_rev',
'dep_type': 'git'}, 'dep_type': 'git'},
...@@ -735,7 +740,7 @@ class ParseTest(unittest.TestCase): ...@@ -735,7 +740,7 @@ class ParseTest(unittest.TestCase):
' "a_dep": "a_url@a_rev"', ' "a_dep": "a_url@a_rev"',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': {'a_dep': {'url': 'a_url@a_rev', 'deps': {'a_dep': {'url': 'a_url@a_rev',
'dep_type': 'git'}}, 'dep_type': 'git'}},
...@@ -755,7 +760,7 @@ class ParseTest(unittest.TestCase): ...@@ -755,7 +760,7 @@ class ParseTest(unittest.TestCase):
' "a_dep": "a_url@a_rev"', ' "a_dep": "a_url@a_rev"',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': { 'deps': {
'a_dep': {'url': 'a_url@a_rev', 'a_dep': {'url': 'a_url@a_rev',
...@@ -775,7 +780,7 @@ class ParseTest(unittest.TestCase): ...@@ -775,7 +780,7 @@ class ParseTest(unittest.TestCase):
' "a_dep": "a_url@a_rev"', ' "a_dep": "a_url@a_rev"',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
'deps': { 'deps': {
'a_dep': {'url': 'a_url@a_rev', 'a_dep': {'url': 'a_url@a_rev',
...@@ -799,7 +804,7 @@ class ParseTest(unittest.TestCase): ...@@ -799,7 +804,7 @@ class ParseTest(unittest.TestCase):
' "a_dep": "a_url@b_rev"', ' "a_dep": "a_url@b_rev"',
' },', ' },',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertIn('conflicts with existing deps', str(cm.exception)) self.assertIn('conflicts with existing deps', str(cm.exception))
def test_merges_hooks_os(self): def test_merges_hooks_os(self):
...@@ -817,7 +822,7 @@ class ParseTest(unittest.TestCase): ...@@ -817,7 +822,7 @@ class ParseTest(unittest.TestCase):
' },', ' },',
' ]', ' ]',
'}', '}',
]), validate_syntax, '<unknown>') ]), False, validate_syntax, '<unknown>')
self.assertEqual({ self.assertEqual({
"hooks": [{"action": ["a", "action"]}, "hooks": [{"action": ["a", "action"]},
{"action": ["b", "action"], "condition": "checkout_mac"}], {"action": ["b", "action"], "condition": "checkout_mac"}],
......
...@@ -839,15 +839,13 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -839,15 +839,13 @@ class GClientSmokeGIT(GClientSmokeBase):
'}', '}',
])) ]))
results = self.gclient([ self.gclient([
'setdep', '-r', 'foo@new_foo', '-r', 'bar@new_bar', 'setdep', '-r', 'foo@new_foo', '-r', 'bar@new_bar',
'--var', 'foo_var=new_val', '--deps-file', fake_deps]) '--var', 'foo_var=new_val', '--deps-file', fake_deps])
with open(fake_deps) as f: with open(fake_deps) as f:
contents = f.read().splitlines() contents = f.read().splitlines()
self.assertEqual('', results[1])
self.assertEqual(0, results[2])
self.assertEqual([ self.assertEqual([
'vars = { ', 'vars = { ',
' "foo_var": "new_val",', ' "foo_var": "new_val",',
...@@ -881,13 +879,11 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -881,13 +879,11 @@ class GClientSmokeGIT(GClientSmokeBase):
'getdep', '-r', 'foo', '-r', 'bar','--var', 'foo_var', 'getdep', '-r', 'foo', '-r', 'bar','--var', 'foo_var',
'--deps-file', fake_deps]) '--deps-file', fake_deps])
self.assertEqual('', results[1])
self.assertEqual([ self.assertEqual([
'foo_val', 'foo_val',
'foo_rev', 'foo_rev',
'bar_rev', 'bar_rev',
], results[0].splitlines()) ], results[0].splitlines())
self.assertEqual(0, results[2])
def testFlatten(self): def testFlatten(self):
if not self.enabled: if not self.enabled:
...@@ -932,7 +928,7 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -932,7 +928,7 @@ class GClientSmokeGIT(GClientSmokeBase):
'deps = {', 'deps = {',
' # src -> src/repo2 -> foo/bar', ' # src -> src/repo2 -> foo/bar',
' "foo/bar": {', ' "foo/bar": {',
' "url": "' + self.git_base + 'repo_3",', ' "url": "/repo_3",',
' "condition": \'(repo2_false_var) and (true_str_var)\',', ' "condition": \'(repo2_false_var) and (true_str_var)\',',
' },', ' },',
'', '',
...@@ -943,43 +939,43 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -943,43 +939,43 @@ class GClientSmokeGIT(GClientSmokeBase):
'', '',
' # src -> src/mac_repo', ' # src -> src/mac_repo',
' "src/mac_repo": {', ' "src/mac_repo": {',
' "url": "' + self.git_base + 'repo_5",', ' "url": "{repo5_var}",',
' "condition": \'checkout_mac\',', ' "condition": \'checkout_mac\',',
' },', ' },',
'', '',
' # src -> src/repo8 -> src/recursed_os_repo', ' # src -> src/repo8 -> src/recursed_os_repo',
' "src/recursed_os_repo": {', ' "src/recursed_os_repo": {',
' "url": "' + self.git_base + 'repo_5",', ' "url": "/repo_5",',
' "condition": \'(checkout_linux) or (checkout_mac)\',', ' "condition": \'(checkout_linux) or (checkout_mac)\',',
' },', ' },',
'', '',
' # src -> src/repo2', ' # src -> src/repo2',
' "src/repo2": {', ' "src/repo2": {',
' "url": "' + self.git_base + 'repo_2@%s",' % ( ' "url": "{git_base}repo_2@%s",' % (
self.githash('repo_2', 1)[:7]), self.githash('repo_2', 1)[:7]),
' "condition": \'true_str_var\',', ' "condition": \'true_str_var\',',
' },', ' },',
'', '',
' # src -> src/repo4', ' # src -> src/repo4',
' "src/repo4": {', ' "src/repo4": {',
' "url": "' + self.git_base + 'repo_4",', ' "url": "/repo_4",',
' "condition": \'False\',', ' "condition": \'False\',',
' },', ' },',
'', '',
' # src -> src/repo8', ' # src -> src/repo8',
' "src/repo8": {', ' "src/repo8": {',
' "url": "' + self.git_base + 'repo_8",', ' "url": "/repo_8",',
' },', ' },',
'', '',
' # src -> src/unix_repo', ' # src -> src/unix_repo',
' "src/unix_repo": {', ' "src/unix_repo": {',
' "url": "' + self.git_base + 'repo_5",', ' "url": "{repo5_var}",',
' "condition": \'checkout_linux\',', ' "condition": \'checkout_linux\',',
' },', ' },',
'', '',
' # src -> src/win_repo', ' # src -> src/win_repo',
' "src/win_repo": {', ' "src/win_repo": {',
' "url": "' + self.git_base + 'repo_5",', ' "url": "{repo5_var}",',
' "condition": \'checkout_win\',', ' "condition": \'checkout_win\',',
' },', ' },',
'', '',
...@@ -995,7 +991,7 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -995,7 +991,7 @@ class GClientSmokeGIT(GClientSmokeBase):
' "python",', ' "python",',
' "-c",', ' "-c",',
' "open(\'src/git_hooked1\', \'w\')' ' "open(\'src/git_hooked1\', \'w\')'
'.write(\'git_hooked1\')",', '.write(\'{hook1_contents}\')",',
' ]', ' ]',
' },', ' },',
'', '',
...@@ -1093,8 +1089,7 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -1093,8 +1089,7 @@ class GClientSmokeGIT(GClientSmokeBase):
'deps = {', 'deps = {',
' # src -> src/repo2 -> foo/bar', ' # src -> src/repo2 -> foo/bar',
' "foo/bar": {', ' "foo/bar": {',
' "url": "' + self.git_base + 'repo_3@%s",' % ( ' "url": "/repo_3@%s",' % (self.githash('repo_3', 2)),
self.githash('repo_3', 2)),
' "condition": \'(repo2_false_var) and (true_str_var)\',', ' "condition": \'(repo2_false_var) and (true_str_var)\',',
' },', ' },',
'', '',
...@@ -1106,49 +1101,43 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -1106,49 +1101,43 @@ class GClientSmokeGIT(GClientSmokeBase):
'', '',
' # src -> src/mac_repo', ' # src -> src/mac_repo',
' "src/mac_repo": {', ' "src/mac_repo": {',
' "url": "' + self.git_base + 'repo_5@%s",' % ( ' "url": "{repo5_var}@%s",' % (self.githash('repo_5', 3)),
self.githash('repo_5', 3)),
' "condition": \'checkout_mac\',', ' "condition": \'checkout_mac\',',
' },', ' },',
'', '',
' # src -> src/repo8 -> src/recursed_os_repo', ' # src -> src/repo8 -> src/recursed_os_repo',
' "src/recursed_os_repo": {', ' "src/recursed_os_repo": {',
' "url": "' + self.git_base + 'repo_5@%s",' % ( ' "url": "/repo_5@%s",' % (self.githash('repo_5', 3)),
self.githash('repo_5', 3)),
' "condition": \'(checkout_linux) or (checkout_mac)\',', ' "condition": \'(checkout_linux) or (checkout_mac)\',',
' },', ' },',
'', '',
' # src -> src/repo2', ' # src -> src/repo2',
' "src/repo2": {', ' "src/repo2": {',
' "url": "' + self.git_base + 'repo_2@%s",' % ( ' "url": "{git_base}repo_2@%s",' % (
self.githash('repo_2', 1)), self.githash('repo_2', 1)),
' "condition": \'true_str_var\',', ' "condition": \'true_str_var\',',
' },', ' },',
'', '',
' # src -> src/repo4', ' # src -> src/repo4',
' "src/repo4": {', ' "src/repo4": {',
' "url": "' + self.git_base + 'repo_4@%s",' % ( ' "url": "/repo_4@%s",' % (self.githash('repo_4', 2)),
self.githash('repo_4', 2)),
' "condition": \'False\',', ' "condition": \'False\',',
' },', ' },',
'', '',
' # src -> src/repo8', ' # src -> src/repo8',
' "src/repo8": {', ' "src/repo8": {',
' "url": "' + self.git_base + 'repo_8@%s",' % ( ' "url": "/repo_8@%s",' % (self.githash('repo_8', 1)),
self.githash('repo_8', 1)),
' },', ' },',
'', '',
' # src -> src/unix_repo', ' # src -> src/unix_repo',
' "src/unix_repo": {', ' "src/unix_repo": {',
' "url": "' + self.git_base + 'repo_5@%s",' % ( ' "url": "{repo5_var}@%s",' % (self.githash('repo_5', 3)),
self.githash('repo_5', 3)),
' "condition": \'checkout_linux\',', ' "condition": \'checkout_linux\',',
' },', ' },',
'', '',
' # src -> src/win_repo', ' # src -> src/win_repo',
' "src/win_repo": {', ' "src/win_repo": {',
' "url": "' + self.git_base + 'repo_5@%s",' % ( ' "url": "{repo5_var}@%s",' % (self.githash('repo_5', 3)),
self.githash('repo_5', 3)),
' "condition": \'checkout_win\',', ' "condition": \'checkout_win\',',
' },', ' },',
'', '',
...@@ -1164,7 +1153,7 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -1164,7 +1153,7 @@ class GClientSmokeGIT(GClientSmokeBase):
' "python",', ' "python",',
' "-c",', ' "-c",',
' "open(\'src/git_hooked1\', \'w\')' ' "open(\'src/git_hooked1\', \'w\')'
'.write(\'git_hooked1\')",', '.write(\'{hook1_contents}\')",',
' ]', ' ]',
' },', ' },',
'', '',
...@@ -1267,46 +1256,46 @@ class GClientSmokeGIT(GClientSmokeBase): ...@@ -1267,46 +1256,46 @@ class GClientSmokeGIT(GClientSmokeBase):
'', '',
' # src -> src/repo9 -> src/repo8 -> src/recursed_os_repo', ' # src -> src/repo9 -> src/repo8 -> src/recursed_os_repo',
' "src/recursed_os_repo": {', ' "src/recursed_os_repo": {',
' "url": "' + self.git_base + 'repo_5",', ' "url": "/repo_5",',
' "condition": \'(checkout_linux) or (checkout_mac)\',', ' "condition": \'(checkout_linux) or (checkout_mac)\',',
' },', ' },',
'', '',
' # src -> src/repo11', ' # src -> src/repo11',
' "src/repo11": {', ' "src/repo11": {',
' "url": "' + self.git_base + 'repo_11",', ' "url": "/repo_11",',
' "condition": \'(checkout_ios) or (checkout_mac)\',', ' "condition": \'(checkout_ios) or (checkout_mac)\',',
' },', ' },',
'', '',
' # src -> src/repo11 -> src/repo12', ' # src -> src/repo11 -> src/repo12',
' "src/repo12": {', ' "src/repo12": {',
' "url": "' + self.git_base + 'repo_12",', ' "url": "/repo_12",',
' "condition": \'(checkout_ios) or (checkout_mac)\',', ' "condition": \'(checkout_ios) or (checkout_mac)\',',
' },', ' },',
'', '',
' # src -> src/repo9 -> src/repo4', ' # src -> src/repo9 -> src/repo4',
' "src/repo4": {', ' "src/repo4": {',
' "url": "' + self.git_base + 'repo_4",', ' "url": "/repo_4",',
' "condition": \'checkout_android\',', ' "condition": \'checkout_android\',',
' },', ' },',
'', '',
' # src -> src/repo6', ' # src -> src/repo6',
' "src/repo6": {', ' "src/repo6": {',
' "url": "' + self.git_base + 'repo_6",', ' "url": "/repo_6",',
' },', ' },',
'', '',
' # src -> src/repo9 -> src/repo7', ' # src -> src/repo9 -> src/repo7',
' "src/repo7": {', ' "src/repo7": {',
' "url": "' + self.git_base + 'repo_7",', ' "url": "/repo_7",',
' },', ' },',
'', '',
' # src -> src/repo9 -> src/repo8', ' # src -> src/repo9 -> src/repo8',
' "src/repo8": {', ' "src/repo8": {',
' "url": "' + self.git_base + 'repo_8",', ' "url": "/repo_8",',
' },', ' },',
'', '',
' # src -> src/repo9', ' # src -> src/repo9',
' "src/repo9": {', ' "src/repo9": {',
' "url": "' + self.git_base + 'repo_9",', ' "url": "/repo_9",',
' },', ' },',
'', '',
'}', '}',
......
...@@ -201,7 +201,7 @@ class GclientTest(trial_dir.TestCase): ...@@ -201,7 +201,7 @@ class GclientTest(trial_dir.TestCase):
# auto-fixed. # auto-fixed.
url = 'proto://host/path/@revision' url = 'proto://host/path/@revision'
d = gclient.Dependency( d = gclient.Dependency(
None, 'name', url, None, None, None, None, 'name', url, url, None, None, None,
None, '', True, False, None, True) None, '', True, False, None, True)
self.assertEquals('proto://host/path@revision', d.url) self.assertEquals('proto://host/path@revision', d.url)
...@@ -212,10 +212,10 @@ class GclientTest(trial_dir.TestCase): ...@@ -212,10 +212,10 @@ class GclientTest(trial_dir.TestCase):
obj.add_dependencies_and_close( obj.add_dependencies_and_close(
[ [
gclient.Dependency( gclient.Dependency(
obj, 'foo', 'svn://example.com/foo', None, obj, 'foo', 'svn://example.com/foo', 'svn://example.com/foo', None,
None, None, None, 'DEPS', True, False, None, True), None, None, None, 'DEPS', True, False, None, True),
gclient.Dependency( gclient.Dependency(
obj, 'bar', 'svn://example.com/bar', None, obj, 'bar', 'svn://example.com/bar', 'svn://example.com/bar', None,
None, None, None, 'DEPS', True, False, None, True), None, None, None, 'DEPS', True, False, None, True),
], ],
[]) [])
...@@ -223,7 +223,7 @@ class GclientTest(trial_dir.TestCase): ...@@ -223,7 +223,7 @@ class GclientTest(trial_dir.TestCase):
[ [
gclient.Dependency( gclient.Dependency(
obj.dependencies[0], 'foo/dir1', 'svn://example.com/foo/dir1', obj.dependencies[0], 'foo/dir1', 'svn://example.com/foo/dir1',
None, None, None, None, 'DEPS', True, 'svn://example.com/foo/dir1', None, None, None, None, 'DEPS', True,
False, None, True), False, None, True),
], ],
[]) [])
...@@ -1130,7 +1130,7 @@ class GclientTest(trial_dir.TestCase): ...@@ -1130,7 +1130,7 @@ class GclientTest(trial_dir.TestCase):
obj.add_dependencies_and_close( obj.add_dependencies_and_close(
[ [
gclient.Dependency( gclient.Dependency(
obj, 'foo', 'svn://example.com/foo', None, obj, 'foo', 'svn://example.com/foo', 'svn://example.com/foo', None,
None, None, None, 'DEPS', True, None, None, None, 'DEPS', True,
False, None, True), False, None, True),
], ],
......
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