Commit ed1bb34f authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

gclient: Remove condition_value.

It not used anywhere.

Bug: 839925
Change-Id: Iad07b548744f2c58d34427f3e2225d8c75926eea
Reviewed-on: https://chromium-review.googlesource.com/1060632
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
parent 16f4bad9
...@@ -241,8 +241,7 @@ class DependencySettings(object): ...@@ -241,8 +241,7 @@ class DependencySettings(object):
"""Immutable configuration settings.""" """Immutable configuration settings."""
def __init__( def __init__(
self, parent, raw_url, url, managed, custom_deps, custom_vars, self, parent, raw_url, url, managed, custom_deps, custom_vars,
custom_hooks, deps_file, should_process, relative, custom_hooks, deps_file, should_process, relative, condition):
condition, condition_value):
# These are not mutable: # These are not mutable:
self._parent = parent self._parent = parent
self._deps_file = deps_file self._deps_file = deps_file
...@@ -250,8 +249,6 @@ class DependencySettings(object): ...@@ -250,8 +249,6 @@ class DependencySettings(object):
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
# Boolean value of the condition. If there's no condition, just True.
self._condition_value = condition_value
# 'managed' determines whether or not this dependency is synced/updated by # 'managed' determines whether or not this dependency is synced/updated by
# gclient after gclient checks it out initially. The difference between # gclient after gclient checks it out initially. The difference between
# 'managed' and 'should_process' is that the user specifies 'managed' via # 'managed' and 'should_process' is that the user specifies 'managed' via
...@@ -340,10 +337,6 @@ class DependencySettings(object): ...@@ -340,10 +337,6 @@ class DependencySettings(object):
def condition(self): def condition(self):
return self._condition return self._condition
@property
def condition_value(self):
return self._condition_value
@property @property
def target_os(self): def target_os(self):
if self.local_target_os is not None: if self.local_target_os is not None:
...@@ -374,12 +367,11 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -374,12 +367,11 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
def __init__(self, parent, name, raw_url, 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, condition_value, 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, raw_url, url, managed, custom_deps, custom_vars, self, parent, raw_url, url, managed, custom_deps, custom_vars,
custom_hooks, deps_file, should_process, relative, custom_hooks, deps_file, should_process, relative, condition)
condition, condition_value)
# This is in both .gclient and DEPS files: # This is in both .gclient and DEPS files:
self._deps_hooks = [] self._deps_hooks = []
...@@ -641,12 +633,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -641,12 +633,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
condition = dep_value.get('condition') condition = dep_value.get('condition')
dep_type = dep_value.get('dep_type') dep_type = dep_value.get('dep_type')
condition_value = True if condition and not self._get_option('process_all_deps', False):
if condition: should_process = should_process and gclient_eval.EvaluateCondition(
condition_value = gclient_eval.EvaluateCondition(
condition, self.get_vars()) condition, self.get_vars())
if not self._get_option('process_all_deps', False):
should_process = should_process and condition_value
if dep_type == 'cipd': if dep_type == 'cipd':
cipd_root = self.GetCipdRoot() cipd_root = self.GetCipdRoot()
...@@ -658,17 +647,15 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -658,17 +647,15 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
package['version'] = version package['version'] = version
deps_to_add.append( deps_to_add.append(
CipdDependency( CipdDependency(
self, name, package, cipd_root, self, name, package, cipd_root, self.custom_vars,
self.custom_vars, should_process, use_relative_paths, should_process, use_relative_paths, condition))
condition, condition_value))
else: else:
raw_url = dep_value.get('url') raw_url = dep_value.get('url')
url = raw_url.format(**self.get_vars()) if raw_url else None url = raw_url.format(**self.get_vars()) if raw_url else None
deps_to_add.append( deps_to_add.append(
GitDependency( GitDependency(
self, name, raw_url, 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))
condition_value))
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
...@@ -1407,7 +1394,6 @@ it or fix the checkout. ...@@ -1407,7 +1394,6 @@ it or fix the checkout.
True, True,
None, None,
None, None,
True,
True)) True))
except KeyError: except KeyError:
raise gclient_utils.Error('Invalid .gclient file. Solution is ' raise gclient_utils.Error('Invalid .gclient file. Solution is '
...@@ -1821,14 +1807,14 @@ class CipdDependency(Dependency): ...@@ -1821,14 +1807,14 @@ class CipdDependency(Dependency):
def __init__( def __init__(
self, parent, name, dep_value, cipd_root, self, parent, name, dep_value, cipd_root,
custom_vars, should_process, relative, condition, condition_value): custom_vars, should_process, relative, condition):
package = dep_value['package'] package = dep_value['package']
version = dep_value['version'] version = dep_value['version']
url = urlparse.urljoin( url = urlparse.urljoin(
cipd_root.service_url, '%s@%s' % (package, version)) cipd_root.service_url, '%s@%s' % (package, version))
super(CipdDependency, self).__init__( super(CipdDependency, self).__init__(
parent, name + ':' + package, url, url, None, None, custom_vars, parent, name + ':' + package, url, url, None, None, custom_vars,
None, None, should_process, relative, condition, condition_value) None, None, should_process, relative, condition)
if relative: if relative:
# TODO(jbudorick): Implement relative if necessary. # TODO(jbudorick): Implement relative if necessary.
raise gclient_utils.Error( raise gclient_utils.Error(
......
...@@ -1098,12 +1098,12 @@ class GclientTest(trial_dir.TestCase): ...@@ -1098,12 +1098,12 @@ class GclientTest(trial_dir.TestCase):
{'package': 'foo_package', {'package': 'foo_package',
'version': 'foo_version'}, 'version': 'foo_version'},
cipd_root, None, True, False, cipd_root, None, True, False,
'fake_condition', True), 'fake_condition'),
gclient.CipdDependency(obj.dependencies[0], 'foo', gclient.CipdDependency(obj.dependencies[0], 'foo',
{'package': 'bar_package', {'package': 'bar_package',
'version': 'bar_version'}, 'version': 'bar_version'},
cipd_root, None, True, False, cipd_root, None, True, False,
'fake_condition', True), 'fake_condition'),
], ],
[]) [])
dep0 = obj.dependencies[0].dependencies[0] dep0 = obj.dependencies[0].dependencies[0]
......
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