From d38a2da9f1502d409c5a014e205c1fea07f2e167 Mon Sep 17 00:00:00 2001 From: Sergiy Byelozyorov Date: Mon, 2 Jul 2018 17:28:54 +0000 Subject: [PATCH] Use cwd from context instead of kwargs It is not possible to use cwd argument, since none of the methods called by this module define cwd explicitly and low-level modules like api.step do not support it anymore, resulting in a TypeError exception thrown due to unexpected keyword argument, e.g. see https://ci.chromium.org/swarming/task/3e74a52905a71110. Given that any users using cwd argument would be broken anyway, it should be safe to make this change. Planned usage: https://crrev.com/c/1122874 R=tandrii@chromium.org, iannucci@chromium.org Bug: 793687 Change-Id: Iadf6bf91d8d41dbc6751a848bb69d7922a206ade Reviewed-on: https://chromium-review.googlesource.com/1122873 Reviewed-by: Robbie Iannucci Commit-Queue: Sergiy Byelozyorov --- recipes/recipe_modules/gclient/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipe_modules/gclient/api.py b/recipes/recipe_modules/gclient/api.py index e4417aace..58e7da9d4 100644 --- a/recipes/recipe_modules/gclient/api.py +++ b/recipes/recipe_modules/gclient/api.py @@ -254,7 +254,7 @@ class GclientApi(recipe_api.RecipeApi): name = 'recurse (git config %s)' % var self(name, ['recurse', 'git', 'config', var, val], **kwargs) finally: - cwd = kwargs.get('cwd', self.m.path['start_dir']) + cwd = self.m.context.cwd or self.m.path['start_dir'] if 'checkout' not in self.m.path: self.m.path['checkout'] = cwd.join( *cfg.solutions[0].name.split(self.m.path.sep))