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

gclient: Remove URLs from hierarchy.

Bug: 839925
Change-Id: I66d0bd074433288e780e1bdde9ebfce4fa85db0f
Reviewed-on: https://chromium-review.googlesource.com/1067496Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 54a5c2ba
...@@ -438,7 +438,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -438,7 +438,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
condition_part = ([' "condition": %r,' % self.condition] condition_part = ([' "condition": %r,' % self.condition]
if self.condition else []) if self.condition else [])
s.extend([ s.extend([
' # %s' % self.hierarchy(include_url=False), ' # %s' % self.hierarchy(),
' "%s": {' % (self.name,), ' "%s": {' % (self.name,),
' "url": "%s",' % (self.raw_url,), ' "url": "%s",' % (self.raw_url,),
] + condition_part + [ ] + condition_part + [
...@@ -1120,16 +1120,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -1120,16 +1120,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
def __repr__(self): def __repr__(self):
return '%s: %s' % (self.name, self.url) return '%s: %s' % (self.name, self.url)
def hierarchy(self, include_url=True): def hierarchy(self):
"""Returns a human-readable hierarchical reference to a Dependency.""" """Returns a human-readable hierarchical reference to a Dependency."""
def format_name(d): out = self.name
if include_url:
return '%s(%s)' % (d.name, d.url)
return d.name
out = format_name(self)
i = self.parent i = self.parent
while i and i.name: while i and i.name:
out = '%s -> %s' % (format_name(i), out) out = '%s -> %s' % (i.name, out)
i = i.parent i = i.parent
return out return out
...@@ -1820,7 +1816,7 @@ class CipdDependency(Dependency): ...@@ -1820,7 +1816,7 @@ class CipdDependency(Dependency):
condition_part = ([' "condition": %r,' % self.condition] condition_part = ([' "condition": %r,' % self.condition]
if self.condition else []) if self.condition else [])
s.extend([ s.extend([
' # %s' % self.hierarchy(include_url=False), ' # %s' % self.hierarchy(),
' "%s": {' % (self.name.split(':')[0],), ' "%s": {' % (self.name.split(':')[0],),
' "packages": [', ' "packages": [',
]) ])
...@@ -2018,7 +2014,7 @@ class Flattener(object): ...@@ -2018,7 +2014,7 @@ class Flattener(object):
# Only include vars explicitly listed in the DEPS files or gclient solution, # Only include vars explicitly listed in the DEPS files or gclient solution,
# not automatic, local overrides (i.e. not all of dep.get_vars()). # not automatic, local overrides (i.e. not all of dep.get_vars()).
hierarchy = dep.hierarchy(include_url=False) hierarchy = dep.hierarchy()
for key, value in dep._vars.iteritems(): for key, value in dep._vars.iteritems():
# Make sure there are no conflicting variables. It is fine however # Make sure there are no conflicting variables. It is fine however
# to use same variable name, as long as the value is consistent. # to use same variable name, as long as the value is consistent.
...@@ -2132,7 +2128,7 @@ def _DepsOsToLines(deps_os): ...@@ -2132,7 +2128,7 @@ def _DepsOsToLines(deps_os):
condition_part = ([' "condition": %r,' % dep.condition] condition_part = ([' "condition": %r,' % dep.condition]
if dep.condition else []) if dep.condition else [])
s.extend([ s.extend([
' # %s' % dep.hierarchy(include_url=False), ' # %s' % dep.hierarchy(),
' "%s": {' % (name,), ' "%s": {' % (name,),
' "url": "%s",' % (dep.raw_url,), ' "url": "%s",' % (dep.raw_url,),
] + condition_part + [ ] + condition_part + [
...@@ -2151,7 +2147,7 @@ def _HooksToLines(name, hooks): ...@@ -2151,7 +2147,7 @@ def _HooksToLines(name, hooks):
s = ['%s = [' % name] s = ['%s = [' % name]
for dep, hook in hooks: for dep, hook in hooks:
s.extend([ s.extend([
' # %s' % dep.hierarchy(include_url=False), ' # %s' % dep.hierarchy(),
' {', ' {',
]) ])
if hook.name is not None: if hook.name is not None:
...@@ -2180,7 +2176,7 @@ def _HooksOsToLines(hooks_os): ...@@ -2180,7 +2176,7 @@ def _HooksOsToLines(hooks_os):
s.append(' "%s": [' % hook_os) s.append(' "%s": [' % hook_os)
for dep, hook in os_hooks: for dep, hook in os_hooks:
s.extend([ s.extend([
' # %s' % dep.hierarchy(include_url=False), ' # %s' % dep.hierarchy(),
' {', ' {',
]) ])
if hook.name is not None: if hook.name is not None:
......
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