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

Side by Side Diff: gclient_scm.py

Issue 14731015: Add option to prevent gclient from changing remote (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 7 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 '\tTo resolve:\n' 311 '\tTo resolve:\n'
312 '\t\trm -rf %s\n' 312 '\t\trm -rf %s\n'
313 '\tAnd run gclient sync again\n' 313 '\tAnd run gclient sync again\n'
314 % (self.relpath, rev_str, self.relpath)) 314 % (self.relpath, rev_str, self.relpath))
315 315
316 # See if the url has changed (the unittests use git://foo for the url, let 316 # See if the url has changed (the unittests use git://foo for the url, let
317 # that through). 317 # that through).
318 current_url = self._Capture(['config', 'remote.origin.url']) 318 current_url = self._Capture(['config', 'remote.origin.url'])
319 # TODO(maruel): Delete url != 'git://foo' since it's just to make the 319 # TODO(maruel): Delete url != 'git://foo' since it's just to make the
320 # unit test pass. (and update the comment above) 320 # unit test pass. (and update the comment above)
321 if current_url != url and url != 'git://foo': 321 if (current_url != url and url != 'git://foo' and
322 self._Capture(['config', 'remote.origin.gclient']) != 'getoffmylawn'):
szym 2013/05/22 00:01:48 If the url is different and remote.origin.gclient
322 print('_____ switching %s to a new upstream' % self.relpath) 323 print('_____ switching %s to a new upstream' % self.relpath)
323 # Make sure it's clean 324 # Make sure it's clean
324 self._CheckClean(rev_str) 325 self._CheckClean(rev_str)
325 # Switch over to the new upstream 326 # Switch over to the new upstream
326 self._Run(['remote', 'set-url', 'origin', url], options) 327 self._Run(['remote', 'set-url', 'origin', url], options)
327 quiet = [] 328 quiet = []
328 if not options.verbose: 329 if not options.verbose:
329 quiet = ['--quiet'] 330 quiet = ['--quiet']
330 self._UpdateBranchHeads(options, fetch=False) 331 self._UpdateBranchHeads(options, fetch=False)
331 self._Run(['fetch', 'origin', '--prune'] + quiet, options) 332 self._Run(['fetch', 'origin', '--prune'] + quiet, options)
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 new_command.append('--force') 1276 new_command.append('--force')
1276 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1277 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1277 new_command.extend(('--accept', 'theirs-conflict')) 1278 new_command.extend(('--accept', 'theirs-conflict'))
1278 elif options.manually_grab_svn_rev: 1279 elif options.manually_grab_svn_rev:
1279 new_command.append('--force') 1280 new_command.append('--force')
1280 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1281 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1281 new_command.extend(('--accept', 'postpone')) 1282 new_command.extend(('--accept', 'postpone'))
1282 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1283 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1283 new_command.extend(('--accept', 'postpone')) 1284 new_command.extend(('--accept', 'postpone'))
1284 return new_command 1285 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