Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 rev_str = ' at %s' % revision | 179 rev_str = ' at %s' % revision |
| 180 files = [] | 180 files = [] |
| 181 | 181 |
| 182 printed_path = False | 182 printed_path = False |
| 183 verbose = [] | 183 verbose = [] |
| 184 if options.verbose: | 184 if options.verbose: |
| 185 print('\n_____ %s%s' % (self.relpath, rev_str)) | 185 print('\n_____ %s%s' % (self.relpath, rev_str)) |
| 186 verbose = ['--verbose'] | 186 verbose = ['--verbose'] |
| 187 printed_path = True | 187 printed_path = True |
| 188 | 188 |
| 189 current_url = self._Capture(['config', 'remote.origin.url']) | |
| 190 if current_url != url: | |
| 191 print('_____ switching %s to a new checkout' % self.relpath) | |
|
M-A Ruel
2011/03/24 14:49:42
to a new upstream
| |
| 192 self._CheckClean(rev_str) | |
|
TVL
2011/03/24 14:43:19
actually, this doesn't seem to catch new files. d
| |
| 193 gclient_utils.RemoveDirectory(self.checkout_path) | |
|
M-A Ruel
2011/03/24 14:49:42
You don't need to remove the directory at all. Som
| |
| 194 | |
| 189 if revision.startswith('refs/heads/'): | 195 if revision.startswith('refs/heads/'): |
| 190 rev_type = "branch" | 196 rev_type = "branch" |
| 191 elif revision.startswith('origin/'): | 197 elif revision.startswith('origin/'): |
| 192 # For compatability with old naming, translate 'origin' to 'refs/heads' | 198 # For compatability with old naming, translate 'origin' to 'refs/heads' |
| 193 revision = revision.replace('origin/', 'refs/heads/') | 199 revision = revision.replace('origin/', 'refs/heads/') |
| 194 rev_type = "branch" | 200 rev_type = "branch" |
| 195 else: | 201 else: |
| 196 # hash is also a tag, only make a distinction at checkout | 202 # hash is also a tag, only make a distinction at checkout |
| 197 rev_type = "hash" | 203 rev_type = "hash" |
| 198 | 204 |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 904 | 910 |
| 905 This method returns a new list to be used as a command.""" | 911 This method returns a new list to be used as a command.""" |
| 906 new_command = command[:] | 912 new_command = command[:] |
| 907 if revision: | 913 if revision: |
| 908 new_command.extend(['--revision', str(revision).strip()]) | 914 new_command.extend(['--revision', str(revision).strip()]) |
| 909 # --force was added to 'svn update' in svn 1.5. | 915 # --force was added to 'svn update' in svn 1.5. |
| 910 if ((options.force or options.manually_grab_svn_rev) and | 916 if ((options.force or options.manually_grab_svn_rev) and |
| 911 scm.SVN.AssertVersion("1.5")[0]): | 917 scm.SVN.AssertVersion("1.5")[0]): |
| 912 new_command.append('--force') | 918 new_command.append('--force') |
| 913 return new_command | 919 return new_command |
| OLD | NEW |