Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Unified Diff: scripts/slave/recipe_modules/git/api.py

Issue 24737002: Add Paths as first-class types in configs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: license Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/git/api.py
diff --git a/scripts/slave/recipe_modules/git/api.py b/scripts/slave/recipe_modules/git/api.py
index ebc91e08c018209f5ebd2e681cca67870b907419..8155e63abab1b676ed32d6fa3de34e0682a7aacf 100644
--- a/scripts/slave/recipe_modules/git/api.py
+++ b/scripts/slave/recipe_modules/git/api.py
@@ -12,7 +12,7 @@ class GitApi(recipe_api.RecipeApi):
if args[0] == 'config' and not args[1].startswith('-'):
name += ' ' + args[1]
if 'cwd' not in kwargs:
- kwargs.setdefault('cwd', self.m.path.checkout())
+ kwargs.setdefault('cwd', self.m.path.checkout)
git_cmd = 'git'
if self.m.platform.is_win:
git_cmd = self.m.path.depot_tools('git.bat')
@@ -24,7 +24,7 @@ class GitApi(recipe_api.RecipeApi):
Args:
url (string): url of remote repo to use as upstream
ref (string): ref to check out after fetching
- dir_path (string): optional directory to clone into
+ dir_path (Path): optional directory to clone into
recursive (bool): whether to recursively fetch submodules or not
keep_paths (iterable of strings): paths to ignore during git-clean;
paths are gitignore-style patterns relative to checkout_path.
@@ -38,8 +38,7 @@ class GitApi(recipe_api.RecipeApi):
dir_path = dir_path or dir_path.rsplit('/', 1)[-1]
dir_path = self.m.path.slave_build(dir_path)
- assert self.m.path.pardir not in dir_path
- self.m.path.add_checkout(dir_path)
+ self.m.path.set_dynamic_path('checkout', dir_path, overwrite=False)
full_ref = 'refs/heads/%s' % ref if '/' not in ref else ref
« no previous file with comments | « scripts/slave/recipe_modules/generator_script/example.py ('k') | scripts/slave/recipe_modules/git/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698