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

Unified Diff: unittests/repo_test_util.py

Issue 2756503003: [autoroll] make autoroller propagate changes to recipes.py. (Closed)
Patch Set: rebase Created 3 years, 9 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 | « unittests/autoroll_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittests/repo_test_util.py
diff --git a/unittests/repo_test_util.py b/unittests/repo_test_util.py
index 3f3795ecdd668b0eccabf80e8dc5a410da1c5263..271d2fb691b1f9eb5745b75ebfbd787892823614 100644
--- a/unittests/repo_test_util.py
+++ b/unittests/repo_test_util.py
@@ -89,11 +89,18 @@ class RepoTest(unittest.TestCase):
subprocess.check_output(['git', 'init'])
subprocess.check_output(['git', 'remote', 'add', 'origin', repo_dir])
with open('recipes.py', 'w') as f:
- f.write('import subprocess, sys\n'
- 'sys.exit(subprocess.call(\n'
- ' [sys.executable, %r, "--package", %r] + sys.argv[1:]))' % (
- self._recipe_tool,
- os.path.join(repo_dir, 'infra', 'config', 'recipes.cfg')))
+ f.write('\n'.join([
+ 'import subprocess, sys, os',
+ '#### PER-REPO CONFIGURATION (editable) ####',
+ 'REPO_ROOT = "."',
+ 'RECIPES_CFG = os.path.join("infra", "config", "recipes.cfg")',
+ '#### END PER-REPO CONFIGURATION ####',
+ 'if sys.argv[1] != "fetch":',
+ ' sys.exit(subprocess.call(',
+ ' [sys.executable, %r, "--package", %r] + sys.argv[1:]))' % (
+ self._recipe_tool,
+ os.path.join(repo_dir, 'infra', 'config', 'recipes.cfg')),
+ ]))
subprocess.check_output(['git', 'add', 'recipes.py'])
rev = self.update_recipes_cfg(name, spec)
return {
« no previous file with comments | « unittests/autoroll_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698