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

Side by Side Diff: scripts/slave/recipe_modules/git/api.py

Issue 1241323004: Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Roll to latest recipes-py Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/slave/recipe_modules/git/__init__.py ('k') | scripts/slave/recipe_modules/gpu/api.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 import itertools
5 import re 6 import re
6 7
7 from recipe_engine import recipe_api 8 from recipe_engine import recipe_api
8 9
9 class GitApi(recipe_api.RecipeApi): 10 class GitApi(recipe_api.RecipeApi):
10 _GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECASE) 11 _GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECASE)
11 12
12 def __call__(self, *args, **kwargs): 13 def __call__(self, *args, **kwargs):
13 """Return a git command step.""" 14 """Return a git command step."""
14 name = kwargs.pop('name', 'git '+args[0]) 15 name = kwargs.pop('name', 'git '+args[0])
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 rev_parse_step = self('rev-parse', 'HEAD', 253 rev_parse_step = self('rev-parse', 'HEAD',
253 cwd=dir_path, 254 cwd=dir_path,
254 name='set got_revision', 255 name='set got_revision',
255 stdout=self.m.raw_io.output(), 256 stdout=self.m.raw_io.output(),
256 can_fail_build=False) 257 can_fail_build=False)
257 258
258 if rev_parse_step.presentation.status == 'SUCCESS': 259 if rev_parse_step.presentation.status == 'SUCCESS':
259 sha = rev_parse_step.stdout.strip() 260 sha = rev_parse_step.stdout.strip()
260 rev_parse_step.presentation.properties['got_revision'] = sha 261 rev_parse_step.presentation.properties['got_revision'] = sha
261 262
262 clean_args = list(self.m.itertools.chain( 263 clean_args = list(itertools.chain(
263 *[('-e', path) for path in keep_paths or []])) 264 *[('-e', path) for path in keep_paths or []]))
264 265
265 self('clean', '-f', '-d', '-x', *clean_args, 266 self('clean', '-f', '-d', '-x', *clean_args,
266 name='git clean%s' % step_suffix, 267 name='git clean%s' % step_suffix,
267 cwd=dir_path, 268 cwd=dir_path,
268 can_fail_build=can_fail_build) 269 can_fail_build=can_fail_build)
269 270
270 if submodules: 271 if submodules:
271 self('submodule', 'sync', 272 self('submodule', 'sync',
272 name='submodule sync%s' % step_suffix, 273 name='submodule sync%s' % step_suffix,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 342
342 Args: 343 Args:
343 bundle_path (Path): The path of the output bundle. 344 bundle_path (Path): The path of the output bundle.
344 refs (list): The list of refs to include in the bundle. If None, all 345 refs (list): The list of refs to include in the bundle. If None, all
345 refs in the Git checkout will be bundled. 346 refs in the Git checkout will be bundled.
346 kwargs: Forwarded to '__call__'. 347 kwargs: Forwarded to '__call__'.
347 """ 348 """
348 if not rev_list_args: 349 if not rev_list_args:
349 rev_list_args = ['--all'] 350 rev_list_args = ['--all']
350 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) 351 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs)
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/git/__init__.py ('k') | scripts/slave/recipe_modules/gpu/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698