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

Side by Side Diff: gclient_scm.py

Issue 244253007: Fix gclient to correctly check out remote refs during update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix comment Created 6 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 from __future__ import print_function 7 from __future__ import print_function
8 8
9 import logging 9 import logging
10 import os 10 import os
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if options.verbose: 334 if options.verbose:
335 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False) 335 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
336 verbose = ['--verbose'] 336 verbose = ['--verbose']
337 printed_path = True 337 printed_path = True
338 338
339 url = self._CreateOrUpdateCache(url, options) 339 url = self._CreateOrUpdateCache(url, options)
340 340
341 if revision.startswith('refs/'): 341 if revision.startswith('refs/'):
342 rev_type = "branch" 342 rev_type = "branch"
343 elif revision.startswith(self.remote + '/'): 343 elif revision.startswith(self.remote + '/'):
344 # For compatibility with old naming, translate 'origin' to 'refs/heads' 344 # Rewrite remote refs to their local equivalents.
345 revision = revision.replace(self.remote + '/', 'refs/heads/') 345 revision = 'refs/remotes/' + revision
346 rev_type = "branch" 346 rev_type = "branch"
347 else: 347 else:
348 # hash is also a tag, only make a distinction at checkout 348 # hash is also a tag, only make a distinction at checkout
349 rev_type = "hash" 349 rev_type = "hash"
350 350
351 if (not os.path.exists(self.checkout_path) or 351 if (not os.path.exists(self.checkout_path) or
352 (os.path.isdir(self.checkout_path) and 352 (os.path.isdir(self.checkout_path) and
353 not os.path.exists(os.path.join(self.checkout_path, '.git')))): 353 not os.path.exists(os.path.join(self.checkout_path, '.git')))):
354 if (os.path.isdir(self.checkout_path) and 354 if (os.path.isdir(self.checkout_path) and
355 not os.path.exists(os.path.join(self.checkout_path, '.git'))): 355 not os.path.exists(os.path.join(self.checkout_path, '.git'))):
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 new_command.append('--force') 1458 new_command.append('--force')
1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1460 new_command.extend(('--accept', 'theirs-conflict')) 1460 new_command.extend(('--accept', 'theirs-conflict'))
1461 elif options.manually_grab_svn_rev: 1461 elif options.manually_grab_svn_rev:
1462 new_command.append('--force') 1462 new_command.append('--force')
1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1464 new_command.extend(('--accept', 'postpone')) 1464 new_command.extend(('--accept', 'postpone'))
1465 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1465 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1466 new_command.extend(('--accept', 'postpone')) 1466 new_command.extend(('--accept', 'postpone'))
1467 return new_command 1467 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