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

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

Issue 1917263002: Revert of depot_tools: add infra_paths recipe module for infra-specific paths (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 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 | « recipe_modules/git/__init__.py ('k') | recipe_modules/git/example.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 itertools
6 import re 6 import re
7 7
8 from recipe_engine import recipe_api 8 from recipe_engine import recipe_api
9 9
10 class GitApi(recipe_api.RecipeApi): 10 class GitApi(recipe_api.RecipeApi):
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 # unreadable. 168 # unreadable.
169 display_fetch_size = display_fetch_size or False 169 display_fetch_size = display_fetch_size or False
170 if not dir_path: 170 if not dir_path:
171 dir_path = url.rsplit('/', 1)[-1] 171 dir_path = url.rsplit('/', 1)[-1]
172 if dir_path.endswith('.git'): # ex: https://host/foobar.git 172 if dir_path.endswith('.git'): # ex: https://host/foobar.git
173 dir_path = dir_path[:-len('.git')] 173 dir_path = dir_path[:-len('.git')]
174 174
175 # ex: ssh://host:repo/foobar/.git 175 # ex: ssh://host:repo/foobar/.git
176 dir_path = dir_path or dir_path.rsplit('/', 1)[-1] 176 dir_path = dir_path or dir_path.rsplit('/', 1)[-1]
177 177
178 dir_path = self.m.infra_paths['slave_build'].join(dir_path) 178 dir_path = self.m.path['slave_build'].join(dir_path)
179 179
180 if 'checkout' not in self.m.path: 180 if 'checkout' not in self.m.path:
181 self.m.path['checkout'] = dir_path 181 self.m.path['checkout'] = dir_path
182 182
183 git_setup_args = ['--path', dir_path, '--url', url] 183 git_setup_args = ['--path', dir_path, '--url', url]
184 184
185 if remote_name: 185 if remote_name:
186 git_setup_args += ['--remote', remote_name] 186 git_setup_args += ['--remote', remote_name]
187 else: 187 else:
188 remote_name = 'origin' 188 remote_name = 'origin'
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 Args: 369 Args:
370 bundle_path (Path): The path of the output bundle. 370 bundle_path (Path): The path of the output bundle.
371 refs (list): The list of refs to include in the bundle. If None, all 371 refs (list): The list of refs to include in the bundle. If None, all
372 refs in the Git checkout will be bundled. 372 refs in the Git checkout will be bundled.
373 kwargs: Forwarded to '__call__'. 373 kwargs: Forwarded to '__call__'.
374 """ 374 """
375 if not rev_list_args: 375 if not rev_list_args:
376 rev_list_args = ['--all'] 376 rev_list_args = ['--all']
377 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs) 377 self('bundle', 'create', bundle_path, *rev_list_args, **kwargs)
OLDNEW
« no previous file with comments | « recipe_modules/git/__init__.py ('k') | recipe_modules/git/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698