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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | recipe_modules/gclient/config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from recipe_engine import recipe_api 5 from recipe_engine import recipe_api
6 6
7 7
8 class RevisionResolver(object): 8 class RevisionResolver(object):
9 """Resolves the revision based on build properties.""" 9 """Resolves the revision based on build properties."""
10 10
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 blink) 314 blink)
315 """ 315 """
316 return ( 316 return (
317 self.m.properties.get('top_of_tree_blink') or 317 self.m.properties.get('top_of_tree_blink') or
318 self.m.properties.get('patch_project') == 'blink') 318 self.m.properties.get('patch_project') == 'blink')
319 319
320 def break_locks(self): 320 def break_locks(self):
321 """Remove all index.lock files. If a previous run of git crashed, bot was 321 """Remove all index.lock files. If a previous run of git crashed, bot was
322 reset, etc... we might end up with leftover index.lock files. 322 reset, etc... we might end up with leftover index.lock files.
323 """ 323 """
324 self.m.python.inline( 324 if self.c and self.c.break_locks_flag:
325 'cleanup index.lock', 325 self.m.python.inline(
326 """ 326 'cleanup index.lock',
327 import os, sys 327 """
328 import os, sys
328 329
329 build_path = sys.argv[1] 330 build_path = sys.argv[1]
330 if os.path.exists(build_path): 331 if os.path.exists(build_path):
331 for (path, dir, files) in os.walk(build_path): 332 for (path, dir, files) in os.walk(build_path):
332 for cur_file in files: 333 for cur_file in files:
333 if cur_file.endswith('index.lock'): 334 if cur_file.endswith('index.lock'):
334 path_to_file = os.path.join(path, cur_file) 335 path_to_file = os.path.join(path, cur_file)
335 print 'deleting %s' % path_to_file 336 os.remove(path_to_file)
336 os.remove(path_to_file) 337 """,
337 """, 338 args=[self.m.path['slave_build']],
338 args=[self.m.path['slave_build']], 339 infra_step=True,
339 infra_step=True, 340 )
340 ) 341 else:
342 self.m.python.inline(
343 'cleanup index.lock',
344 """
345 import os, sys
346
347 build_path = sys.argv[1]
348 if os.path.exists(build_path):
349 for (path, dir, files) in os.walk(build_path):
350 for cur_file in files:
351 if cur_file.endswith('index.lock'):
352 path_to_file = os.path.join(path, cur_file)
353 print 'deleting %s' % path_to_file
354 os.remove(path_to_file)
355 """,
356 args=[self.m.path['slave_build']],
357 infra_step=True,
358 )
341 359
342 def calculate_patch_root(self, patch_project, gclient_config=None): 360 def calculate_patch_root(self, patch_project, gclient_config=None):
343 """Returns path where a patch should be applied to based patch_project. 361 """Returns path where a patch should be applied to based patch_project.
344 362
345 Maps "patch_project" to a path of directories relative to checkout's root, 363 Maps "patch_project" to a path of directories relative to checkout's root,
346 which describe where to place the patch. 364 which describe where to place the patch.
347 365
348 For now, considers only first solution (c.solutions[0]), but in theory can 366 For now, considers only first solution (c.solutions[0]), but in theory can
349 be extended to all of them. 367 be extended to all of them.
350 368
(...skipping 19 matching lines...) Expand all
370 """Updates config revision corresponding to patch_project. 388 """Updates config revision corresponding to patch_project.
371 389
372 Useful for bot_update only, as this is the only consumer of gclient's config 390 Useful for bot_update only, as this is the only consumer of gclient's config
373 revision map. This doesn't overwrite the revision if it was already set. 391 revision map. This doesn't overwrite the revision if it was already set.
374 """ 392 """
375 assert patch_project is None or isinstance(patch_project, basestring) 393 assert patch_project is None or isinstance(patch_project, basestring)
376 cfg = gclient_config or self.c 394 cfg = gclient_config or self.c
377 path, revision = cfg.patch_projects.get(patch_project, (None, None)) 395 path, revision = cfg.patch_projects.get(patch_project, (None, None))
378 if path and revision and path not in cfg.revisions: 396 if path and revision and path not in cfg.revisions:
379 cfg.revisions[path] = revision 397 cfg.revisions[path] = revision
OLDNEW
« 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