From 88be9a1c5abe123558c7f98459dc3743928f3828 Mon Sep 17 00:00:00 2001 From: "szager@chromium.org" Date: Fri, 4 Mar 2016 22:59:59 +0000 Subject: [PATCH] Use gclient's git_cache setting in bot_update/api.py BUG=589140 R=agable@chromium.org Review URL: https://codereview.chromium.org/1762513002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299120 0039d316-1c4b-4281-b951-d872f2087c98 --- recipe_modules/bot_update/api.py | 2 +- recipe_modules/bot_update/example.expected/basic.json | 2 +- .../bot_update/example.expected/basic_output_manifest.json | 2 +- .../bot_update/example.expected/basic_with_branch_heads.json | 2 +- recipe_modules/bot_update/example.expected/clobber.json | 2 +- recipe_modules/bot_update/example.expected/forced.json | 2 +- recipe_modules/bot_update/example.expected/no_shallow.json | 2 +- recipe_modules/bot_update/example.expected/off.json | 2 +- .../example.expected/reset_root_solution_revision.json | 2 +- recipe_modules/bot_update/example.expected/svn_mode.json | 2 +- recipe_modules/bot_update/example.expected/trychange.json | 2 +- .../bot_update/example.expected/trychange_oauth2.json | 2 +- recipe_modules/bot_update/example.expected/tryjob.json | 2 +- recipe_modules/bot_update/example.expected/tryjob_fail.json | 2 +- .../bot_update/example.expected/tryjob_fail_patch.json | 2 +- .../bot_update/example.expected/tryjob_fail_patch_download.json | 2 +- recipe_modules/bot_update/example.expected/tryjob_v8.json | 2 +- recipe_modules/bot_update/example.py | 2 +- recipe_modules/gclient/example.py | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py index ccd725efc..1b2eec3f3 100644 --- a/recipe_modules/bot_update/api.py +++ b/recipe_modules/bot_update/api.py @@ -143,7 +143,7 @@ class BotUpdateApi(recipe_api.RecipeApi): ['--spec', spec_string], ['--root', root], ['--revision_mapping_file', self.m.json.input(rev_map)], - ['--git-cache-dir', self.m.path['git_cache']], + ['--git-cache-dir', cfg.cache_dir], # 3. How to find the patch, if any (issue/patchset/patch_url). ['--issue', issue], diff --git a/recipe_modules/bot_update/example.expected/basic.json b/recipe_modules/bot_update/example.expected/basic.json index 0cff6c0fe..c79f871f7 100644 --- a/recipe_modules/bot_update/example.expected/basic.json +++ b/recipe_modules/bot_update/example.expected/basic.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-m1", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/basic_output_manifest.json b/recipe_modules/bot_update/example.expected/basic_output_manifest.json index 170b4ab6d..1db15d4ab 100644 --- a/recipe_modules/bot_update/example.expected/basic_output_manifest.json +++ b/recipe_modules/bot_update/example.expected/basic_output_manifest.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-m1", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json index 214604319..87c6e1eef 100644 --- a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +++ b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-m1", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/clobber.json b/recipe_modules/bot_update/example.expected/clobber.json index ee6f935c9..653c04de3 100644 --- a/recipe_modules/bot_update/example.expected/clobber.json +++ b/recipe_modules/bot_update/example.expected/clobber.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/forced.json b/recipe_modules/bot_update/example.expected/forced.json index 07b1af682..05d8a4d04 100644 --- a/recipe_modules/bot_update/example.expected/forced.json +++ b/recipe_modules/bot_update/example.expected/forced.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/no_shallow.json b/recipe_modules/bot_update/example.expected/no_shallow.json index 2008a4fa3..dc33024be 100644 --- a/recipe_modules/bot_update/example.expected/no_shallow.json +++ b/recipe_modules/bot_update/example.expected/no_shallow.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/off.json b/recipe_modules/bot_update/example.expected/off.json index 48109b0ba..5fb8384f5 100644 --- a/recipe_modules/bot_update/example.expected/off.json +++ b/recipe_modules/bot_update/example.expected/off.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json index e50485c41..9e34ce633 100644 --- a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +++ b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/svn_mode.json b/recipe_modules/bot_update/example.expected/svn_mode.json index b12f9e40c..de68bd800 100644 --- a/recipe_modules/bot_update/example.expected/svn_mode.json +++ b/recipe_modules/bot_update/example.expected/svn_mode.json @@ -11,7 +11,7 @@ "--slave", "somehost", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/trychange.json b/recipe_modules/bot_update/example.expected/trychange.json index a7aa47328..dddaeb919 100644 --- a/recipe_modules/bot_update/example.expected/trychange.json +++ b/recipe_modules/bot_update/example.expected/trychange.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2.json b/recipe_modules/bot_update/example.expected/trychange_oauth2.json index c81ede5ff..517205dfd 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/tryjob.json b/recipe_modules/bot_update/example.expected/tryjob.json index f34e0fe7e..5eb01c1e9 100644 --- a/recipe_modules/bot_update/example.expected/tryjob.json +++ b/recipe_modules/bot_update/example.expected/tryjob.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail.json b/recipe_modules/bot_update/example.expected/tryjob_fail.json index 66b377c29..8c7e2bb6d 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json index 9e2cd6f8d..0756622d1 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json index e7a93bdf1..8af12190a 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8.json b/recipe_modules/bot_update/example.expected/tryjob_v8.json index f426d8b95..382e2c4f4 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8.json @@ -11,7 +11,7 @@ "--slave", "totallyaslave-c4", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]", "--root", "src/v8", "--revision_mapping_file", diff --git a/recipe_modules/bot_update/example.py b/recipe_modules/bot_update/example.py index d866c0ceb..9e915331e 100644 --- a/recipe_modules/bot_update/example.py +++ b/recipe_modules/bot_update/example.py @@ -12,7 +12,7 @@ DEPS = [ def RunSteps(api): api.gclient.use_mirror = True - src_cfg = api.gclient.make_config() + src_cfg = api.gclient.make_config(GIT_MODE=True, CACHE_DIR='[GIT_CACHE]') soln = src_cfg.solutions.add() soln.name = 'src' soln.url = 'svn://svn.chromium.org/chrome/trunk/src' diff --git a/recipe_modules/gclient/example.py b/recipe_modules/gclient/example.py index bc392354a..fa6daf895 100644 --- a/recipe_modules/gclient/example.py +++ b/recipe_modules/gclient/example.py @@ -58,7 +58,7 @@ def RunSteps(api): for config_name in TEST_CONFIGS: api.gclient.make_config(config_name) - src_cfg = api.gclient.make_config(GIT_MODE=True) + src_cfg = api.gclient.make_config(GIT_MODE=True, CACHE_DIR='[ROOT]/git_cache') soln = src_cfg.solutions.add() soln.name = 'src' soln.url = 'https://chromium.googlesource.com/chromium/src.git'