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

Unified Diff: recipe_modules/gclient/api.py

Issue 1999603002: example flag CL (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 7 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 | recipe_modules/gclient/config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/gclient/api.py
diff --git a/recipe_modules/gclient/api.py b/recipe_modules/gclient/api.py
index 7565fed62b3892c592abc10494f181779a8a6172..22914a8fb8614dc27070ea3fd7bea445e8a687a4 100644
--- a/recipe_modules/gclient/api.py
+++ b/recipe_modules/gclient/api.py
@@ -321,23 +321,41 @@ class GclientApi(recipe_api.RecipeApi):
"""Remove all index.lock files. If a previous run of git crashed, bot was
reset, etc... we might end up with leftover index.lock files.
"""
- self.m.python.inline(
- 'cleanup index.lock',
- """
- import os, sys
-
- build_path = sys.argv[1]
- if os.path.exists(build_path):
- for (path, dir, files) in os.walk(build_path):
- for cur_file in files:
- if cur_file.endswith('index.lock'):
- path_to_file = os.path.join(path, cur_file)
- print 'deleting %s' % path_to_file
- os.remove(path_to_file)
- """,
- args=[self.m.path['slave_build']],
- infra_step=True,
- )
+ if self.c and self.c.break_locks_flag:
+ self.m.python.inline(
+ 'cleanup index.lock',
+ """
+ import os, sys
+
+ build_path = sys.argv[1]
+ if os.path.exists(build_path):
+ for (path, dir, files) in os.walk(build_path):
+ for cur_file in files:
+ if cur_file.endswith('index.lock'):
+ path_to_file = os.path.join(path, cur_file)
+ os.remove(path_to_file)
+ """,
+ args=[self.m.path['slave_build']],
+ infra_step=True,
+ )
+ else:
+ self.m.python.inline(
+ 'cleanup index.lock',
+ """
+ import os, sys
+
+ build_path = sys.argv[1]
+ if os.path.exists(build_path):
+ for (path, dir, files) in os.walk(build_path):
+ for cur_file in files:
+ if cur_file.endswith('index.lock'):
+ path_to_file = os.path.join(path, cur_file)
+ print 'deleting %s' % path_to_file
+ os.remove(path_to_file)
+ """,
+ args=[self.m.path['slave_build']],
+ infra_step=True,
+ )
def calculate_patch_root(self, patch_project, gclient_config=None):
"""Returns path where a patch should be applied to based patch_project.
« no previous file with comments | « no previous file | recipe_modules/gclient/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698