OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 raise gclient_utils.Error('Invalid Upstream') | 253 raise gclient_utils.Error('Invalid Upstream') |
254 | 254 |
255 # Update the remotes first so we have all the refs. | 255 # Update the remotes first so we have all the refs. |
256 for _ in range(10): | 256 for _ in range(10): |
257 try: | 257 try: |
258 remote_output, remote_err = scm.GIT.Capture( | 258 remote_output, remote_err = scm.GIT.Capture( |
259 ['remote'] + verbose + ['update'], | 259 ['remote'] + verbose + ['update'], |
260 self.checkout_path, | 260 self.checkout_path, |
261 print_error=False) | 261 print_error=False) |
262 break | 262 break |
263 except gclient_utils.CheckCallError: | 263 except gclient_utils.CheckCallError, e: |
264 # Hackish but at that point, git is known to work so just checking for | 264 # Hackish but at that point, git is known to work so just checking for |
265 # 502 in stderr should be fine. | 265 # 502 in stderr should be fine. |
266 if '502' in e.stderr: | 266 if '502' in e.stderr: |
267 print str(e) | 267 print str(e) |
268 print "Sleeping 15 seconds and retrying..." | 268 print "Sleeping 15 seconds and retrying..." |
269 time.sleep(15) | 269 time.sleep(15) |
270 continue | 270 continue |
271 raise | 271 raise |
272 | 272 |
273 if verbose: | 273 if verbose: |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " | 859 print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " |
860 "does not exist." | 860 "does not exist." |
861 % (' '.join(command), path)) | 861 % (' '.join(command), path)) |
862 # There's no file list to retrieve. | 862 # There's no file list to retrieve. |
863 else: | 863 else: |
864 scm.SVN.RunAndGetFileList(options, command, path, file_list) | 864 scm.SVN.RunAndGetFileList(options, command, path, file_list) |
865 | 865 |
866 def FullUrlForRelativeUrl(self, url): | 866 def FullUrlForRelativeUrl(self, url): |
867 # Find the forth '/' and strip from there. A bit hackish. | 867 # Find the forth '/' and strip from there. A bit hackish. |
868 return '/'.join(self.url.split('/')[:4]) + url | 868 return '/'.join(self.url.split('/')[:4]) + url |
OLD | NEW |