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

Side by Side Diff: gclient_scm.py

Issue 9692022: If a subdir exists and is empty, go ahead and clone into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 9 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if revision.startswith('refs/heads/'): 212 if revision.startswith('refs/heads/'):
213 rev_type = "branch" 213 rev_type = "branch"
214 elif revision.startswith('origin/'): 214 elif revision.startswith('origin/'):
215 # For compatability with old naming, translate 'origin' to 'refs/heads' 215 # For compatability with old naming, translate 'origin' to 'refs/heads'
216 revision = revision.replace('origin/', 'refs/heads/') 216 revision = revision.replace('origin/', 'refs/heads/')
217 rev_type = "branch" 217 rev_type = "branch"
218 else: 218 else:
219 # hash is also a tag, only make a distinction at checkout 219 # hash is also a tag, only make a distinction at checkout
220 rev_type = "hash" 220 rev_type = "hash"
221 221
222 if not os.path.exists(self.checkout_path): 222 if not os.path.exists(self.checkout_path) or (
223 os.path.isdir(self.checkout_path) and
224 not os.listdir(self.checkout_path)):
223 gclient_utils.safe_makedirs(os.path.dirname(self.checkout_path)) 225 gclient_utils.safe_makedirs(os.path.dirname(self.checkout_path))
224 self._Clone(revision, url, options) 226 self._Clone(revision, url, options)
225 files = self._Capture(['ls-files']).splitlines() 227 files = self._Capture(['ls-files']).splitlines()
226 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) 228 file_list.extend([os.path.join(self.checkout_path, f) for f in files])
227 if not verbose: 229 if not verbose:
228 # Make the output a little prettier. It's nice to have some whitespace 230 # Make the output a little prettier. It's nice to have some whitespace
229 # between projects when cloning. 231 # between projects when cloning.
230 print('') 232 print('')
231 return 233 return
232 234
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 new_command.append('--force') 1129 new_command.append('--force')
1128 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1130 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1129 new_command.extend(('--accept', 'theirs-conflict')) 1131 new_command.extend(('--accept', 'theirs-conflict'))
1130 elif options.manually_grab_svn_rev: 1132 elif options.manually_grab_svn_rev:
1131 new_command.append('--force') 1133 new_command.append('--force')
1132 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1134 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1133 new_command.extend(('--accept', 'postpone')) 1135 new_command.extend(('--accept', 'postpone'))
1134 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1136 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1135 new_command.extend(('--accept', 'postpone')) 1137 new_command.extend(('--accept', 'postpone'))
1136 return new_command 1138 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