OLD | NEW |
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 def GetActualRemoteURL(self, options): | 159 def GetActualRemoteURL(self, options): |
160 """Attempt to determine the remote URL for this SCMWrapper.""" | 160 """Attempt to determine the remote URL for this SCMWrapper.""" |
161 # Git | 161 # Git |
162 if os.path.exists(os.path.join(self.checkout_path, '.git')): | 162 if os.path.exists(os.path.join(self.checkout_path, '.git')): |
163 actual_remote_url = shlex.split(self._Capture( | 163 actual_remote_url = shlex.split(self._Capture( |
164 ['config', '--local', '--get-regexp', r'remote.*.url'], | 164 ['config', '--local', '--get-regexp', r'remote.*.url'], |
165 cwd=self.checkout_path))[1] | 165 cwd=self.checkout_path))[1] |
166 | 166 |
167 # If a cache_dir is used, obtain the actual remote URL from the cache. | 167 # If a cache_dir is used, obtain the actual remote URL from the cache. |
168 if getattr(self, 'cache_dir', None): | 168 if getattr(self, 'cache_dir', None): |
169 mirror = git_cache.Mirror(self.url) | 169 url, _ = gclient_utils.SplitUrlRevision(self.url) |
| 170 mirror = git_cache.Mirror(url) |
170 if (mirror.exists() and mirror.mirror_path.replace('\\', '/') == | 171 if (mirror.exists() and mirror.mirror_path.replace('\\', '/') == |
171 actual_remote_url.replace('\\', '/')): | 172 actual_remote_url.replace('\\', '/')): |
172 actual_remote_url = shlex.split(self._Capture( | 173 actual_remote_url = shlex.split(self._Capture( |
173 ['config', '--local', '--get-regexp', r'remote.*.url'], | 174 ['config', '--local', '--get-regexp', r'remote.*.url'], |
174 cwd=mirror.mirror_path))[1] | 175 cwd=mirror.mirror_path))[1] |
175 return actual_remote_url | 176 return actual_remote_url |
176 | 177 |
177 # Svn | 178 # Svn |
178 if os.path.exists(os.path.join(self.checkout_path, '.svn')): | 179 if os.path.exists(os.path.join(self.checkout_path, '.svn')): |
179 return scm.SVN.CaptureLocalInfo([], self.checkout_path)['URL'] | 180 return scm.SVN.CaptureLocalInfo([], self.checkout_path)['URL'] |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 new_command.append('--force') | 1453 new_command.append('--force') |
1453 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1454 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1454 new_command.extend(('--accept', 'theirs-conflict')) | 1455 new_command.extend(('--accept', 'theirs-conflict')) |
1455 elif options.manually_grab_svn_rev: | 1456 elif options.manually_grab_svn_rev: |
1456 new_command.append('--force') | 1457 new_command.append('--force') |
1457 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1458 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1458 new_command.extend(('--accept', 'postpone')) | 1459 new_command.extend(('--accept', 'postpone')) |
1459 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1460 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1460 new_command.extend(('--accept', 'postpone')) | 1461 new_command.extend(('--accept', 'postpone')) |
1461 return new_command | 1462 return new_command |
OLD | NEW |