diff --git a/gclient.py b/gclient.py index c2f4040e5..626ba80e0 100755 --- a/gclient.py +++ b/gclient.py @@ -1997,7 +1997,7 @@ def _DepsToLines(deps): return [] s = ['deps = {'] for name, dep in sorted(deps.iteritems()): - condition_part = ([' "condition": "%s",' % dep.condition] + condition_part = ([' "condition": %r,' % dep.condition] if dep.condition else []) s.extend([ ' # %s' % dep.hierarchy(include_url=False), @@ -2019,7 +2019,7 @@ def _DepsOsToLines(deps_os): for dep_os, os_deps in sorted(deps_os.iteritems()): s.append(' "%s": {' % dep_os) for name, dep in sorted(os_deps.iteritems()): - condition_part = ([' "condition": "%s",' % dep.condition] + condition_part = ([' "condition": %r,' % dep.condition] if dep.condition else []) s.extend([ ' # %s' % dep.hierarchy(include_url=False), @@ -2049,7 +2049,7 @@ def _HooksToLines(name, hooks): if hook.pattern is not None: s.append(' "pattern": "%s",' % hook.pattern) if hook.condition is not None: - s.append(' "condition": "%s",' % hook.condition) + s.append(' "condition": %r,' % hook.condition) s.extend( # Hooks run in the parent directory of their dep. [' "cwd": "%s",' % os.path.normpath(os.path.dirname(dep.name))] + @@ -2078,7 +2078,7 @@ def _HooksOsToLines(hooks_os): if hook.pattern is not None: s.append(' "pattern": "%s",' % hook.pattern) if hook.condition is not None: - s.append(' "condition": "%s",' % hook.condition) + s.append(' "condition": %r,' % hook.condition) s.extend( # Hooks run in the parent directory of their dep. [' "cwd": "%s",' % os.path.normpath(os.path.dirname(dep.name))] + diff --git a/tests/gclient_smoketest.py b/tests/gclient_smoketest.py index 03065b8e5..b3405733a 100755 --- a/tests/gclient_smoketest.py +++ b/tests/gclient_smoketest.py @@ -662,13 +662,13 @@ class GClientSmokeGIT(GClientSmokeBase): ' "src/repo2": {', ' "url": "{git_base}repo_2@%s",' % ( self.githash('repo_2', 1)[:7]), - ' "condition": "True",', + ' "condition": \'True\',', ' },', '', ' # src -> src/repo4', ' "src/repo4": {', ' "url": "/repo_4",', - ' "condition": "False",', + ' "condition": \'False\',', ' },', '', ' # src -> src/repo8', @@ -719,7 +719,7 @@ class GClientSmokeGIT(GClientSmokeBase): ' # src', ' {', ' "pattern": ".",', - ' "condition": "True",', + ' "condition": \'True\',', ' "cwd": ".",', ' "action": [', ' "python",', @@ -837,13 +837,13 @@ class GClientSmokeGIT(GClientSmokeBase): ' "src/repo2": {', ' "url": "{git_base}repo_2@%s",' % ( self.githash('repo_2', 1)), - ' "condition": "True",', + ' "condition": \'True\',', ' },', '', ' # src -> src/repo4', ' "src/repo4": {', ' "url": "/repo_4@%s",' % (self.githash('repo_4', 2)), - ' "condition": "False",', + ' "condition": \'False\',', ' },', '', ' # src -> src/repo8', @@ -894,7 +894,7 @@ class GClientSmokeGIT(GClientSmokeBase): ' # src', ' {', ' "pattern": ".",', - ' "condition": "True",', + ' "condition": \'True\',', ' "cwd": ".",', ' "action": [', ' "python",',