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

Unified Diff: recipe_modules/tryserver/api.py

Issue 2144473003: tryserver: make it possible to override cwd for get_files_affected_by_patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/tryserver/api.py
diff --git a/recipe_modules/tryserver/api.py b/recipe_modules/tryserver/api.py
index d1d290d6f4629723dc6ab33254159f51d6ef1443..f18c2b5d93227ffe0cf4c351de2dcf3b64dbfdb3 100644
--- a/recipe_modules/tryserver/api.py
+++ b/recipe_modules/tryserver/api.py
@@ -149,7 +149,7 @@ class TryserverApi(recipe_api.RecipeApi):
# Since this method is "maybe", we don't raise an Exception.
pass
- def get_files_affected_by_patch(self, patch_root=None):
+ def get_files_affected_by_patch(self, patch_root=None, **kwargs):
"""Returns list of paths to files affected by the patch.
Argument:
@@ -166,12 +166,14 @@ class TryserverApi(recipe_api.RecipeApi):
# removed.
if patch_root is None:
return self._old_get_files_affected_by_patch()
+ if not kwargs.get('cwd'):
+ kwargs['cwd'] = self.m.path['slave_build'].join(patch_root)
step_result = self.m.git('diff', '--cached', '--name-only',
- cwd=self.m.path['slave_build'].join(patch_root),
name='git diff to analyze patch',
stdout=self.m.raw_io.output(),
step_test_data=lambda:
- self.m.raw_io.test_api.stream_output('foo.cc'))
+ self.m.raw_io.test_api.stream_output('foo.cc'),
+ **kwargs)
paths = [self.m.path.join(patch_root, p) for p in
step_result.stdout.split()]
if self.m.platform.is_win:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698