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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 ### SCM abstraction layer | 84 ### SCM abstraction layer |
85 | 85 |
86 # Factory Method for SCM wrapper creation | 86 # Factory Method for SCM wrapper creation |
87 | 87 |
88 def GetScmName(url): | 88 def GetScmName(url): |
89 if url: | 89 if url: |
90 url, _ = gclient_utils.SplitUrlRevision(url) | 90 url, _ = gclient_utils.SplitUrlRevision(url) |
91 if (url.startswith('git://') or url.startswith('ssh://') or | 91 if (url.startswith('git://') or url.startswith('ssh://') or |
92 url.startswith('git+http://') or url.startswith('git+https://') or | 92 url.startswith('git+http://') or url.startswith('git+https://') or |
93 url.endswith('.git') or url.startswith('sso://')): | 93 url.endswith('.git') or url.startswith('sso://') or |
| 94 'googlesource' in url): |
94 return 'git' | 95 return 'git' |
95 elif (url.startswith('http://') or url.startswith('https://') or | 96 elif (url.startswith('http://') or url.startswith('https://') or |
96 url.startswith('svn://') or url.startswith('svn+ssh://')): | 97 url.startswith('svn://') or url.startswith('svn+ssh://')): |
97 return 'svn' | 98 return 'svn' |
98 return None | 99 return None |
99 | 100 |
100 | 101 |
101 def CreateSCM(url, root_dir=None, relpath=None, out_fh=None, out_cb=None): | 102 def CreateSCM(url, root_dir=None, relpath=None, out_fh=None, out_cb=None): |
102 SCM_MAP = { | 103 SCM_MAP = { |
103 'svn' : SVNWrapper, | 104 'svn' : SVNWrapper, |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 new_command.append('--force') | 1463 new_command.append('--force') |
1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1464 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1464 new_command.extend(('--accept', 'theirs-conflict')) | 1465 new_command.extend(('--accept', 'theirs-conflict')) |
1465 elif options.manually_grab_svn_rev: | 1466 elif options.manually_grab_svn_rev: |
1466 new_command.append('--force') | 1467 new_command.append('--force') |
1467 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1468 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1468 new_command.extend(('--accept', 'postpone')) | 1469 new_command.extend(('--accept', 'postpone')) |
1469 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1470 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1470 new_command.extend(('--accept', 'postpone')) | 1471 new_command.extend(('--accept', 'postpone')) |
1471 return new_command | 1472 return new_command |
OLD | NEW |