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

Side by Side Diff: gclient_scm.py

Issue 13702002: Unpoison gclient checkouts by setting recurseSubmodules=false (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Gclient-specific SCM-specific operations.""" 5 """Gclient-specific SCM-specific operations."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import re 10 import re
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 filter_fn=GitDiffFilterer(self.relpath).Filter) 195 filter_fn=GitDiffFilterer(self.relpath).Filter)
196 196
197 def UpdateSubmoduleConfig(self): 197 def UpdateSubmoduleConfig(self):
198 submod_cmd = ['git', 'config', '-f', '$toplevel/.git/config', 198 submod_cmd = ['git', 'config', '-f', '$toplevel/.git/config',
199 'submodule.$name.ignore', '||', 199 'submodule.$name.ignore', '||',
200 'git', 'config', '-f', '$toplevel/.git/config', 200 'git', 'config', '-f', '$toplevel/.git/config',
201 'submodule.$name.ignore', 'all'] 201 'submodule.$name.ignore', 'all']
202 cmd = ['git', 'submodule', '--quiet', 'foreach', ' '.join(submod_cmd)] 202 cmd = ['git', 'submodule', '--quiet', 'foreach', ' '.join(submod_cmd)]
203 cmd2 = ['git', 'config', 'diff.ignoreSubmodules', 'all'] 203 cmd2 = ['git', 'config', 'diff.ignoreSubmodules', 'all']
204 cmd3 = ['git', 'config', 'branch.autosetupmerge'] 204 cmd3 = ['git', 'config', 'branch.autosetupmerge']
205 cmd4 = ['git', 'config', 'fetch.recurseSubmodules', 'false']
205 kwargs = {'cwd': self.checkout_path, 206 kwargs = {'cwd': self.checkout_path,
206 'print_stdout': False, 207 'print_stdout': False,
207 'filter_fn': lambda x: None} 208 'filter_fn': lambda x: None}
208 try: 209 try:
209 gclient_utils.CheckCallAndFilter(cmd, **kwargs) 210 gclient_utils.CheckCallAndFilter(cmd, **kwargs)
210 gclient_utils.CheckCallAndFilter(cmd2, **kwargs) 211 gclient_utils.CheckCallAndFilter(cmd2, **kwargs)
211 except subprocess2.CalledProcessError: 212 except subprocess2.CalledProcessError:
212 # Not a fatal error, or even very interesting in a non-git-submodule 213 # Not a fatal error, or even very interesting in a non-git-submodule
213 # world. So just keep it quiet. 214 # world. So just keep it quiet.
214 pass 215 pass
215 try: 216 try:
216 gclient_utils.CheckCallAndFilter(cmd3, **kwargs) 217 gclient_utils.CheckCallAndFilter(cmd3, **kwargs)
217 except subprocess2.CalledProcessError: 218 except subprocess2.CalledProcessError:
218 gclient_utils.CheckCallAndFilter(cmd3 + ['always'], **kwargs) 219 gclient_utils.CheckCallAndFilter(cmd3 + ['always'], **kwargs)
219 220
221 gclient_utils.CheckCallAndFilter(cmd4, **kwargs)
222
220 def update(self, options, args, file_list): 223 def update(self, options, args, file_list):
221 """Runs git to update or transparently checkout the working copy. 224 """Runs git to update or transparently checkout the working copy.
222 225
223 All updated files will be appended to file_list. 226 All updated files will be appended to file_list.
224 227
225 Raises: 228 Raises:
226 Error: if can't get URL for relative path. 229 Error: if can't get URL for relative path.
227 """ 230 """
228 if args: 231 if args:
229 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) 232 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args))
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 new_command.append('--force') 1254 new_command.append('--force')
1252 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1255 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1253 new_command.extend(('--accept', 'theirs-conflict')) 1256 new_command.extend(('--accept', 'theirs-conflict'))
1254 elif options.manually_grab_svn_rev: 1257 elif options.manually_grab_svn_rev:
1255 new_command.append('--force') 1258 new_command.append('--force')
1256 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1259 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1257 new_command.extend(('--accept', 'postpone')) 1260 new_command.extend(('--accept', 'postpone'))
1258 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1261 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1259 new_command.extend(('--accept', 'postpone')) 1262 new_command.extend(('--accept', 'postpone'))
1260 return new_command 1263 return new_command
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698