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

Side by Side Diff: gclient_scm.py

Issue 615443002: Let gclient config accept file:// urls. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 2 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
« 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 from __future__ import print_function 7 from __future__ import print_function
8 8
9 import errno 9 import errno
10 import logging 10 import logging
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if url: 90 if url:
91 url, _ = gclient_utils.SplitUrlRevision(url) 91 url, _ = gclient_utils.SplitUrlRevision(url)
92 if (url.startswith('git://') or url.startswith('ssh://') or 92 if (url.startswith('git://') or url.startswith('ssh://') or
93 url.startswith('git+http://') or url.startswith('git+https://') or 93 url.startswith('git+http://') or url.startswith('git+https://') or
94 url.endswith('.git') or url.startswith('sso://') or 94 url.endswith('.git') or url.startswith('sso://') or
95 'googlesource' in url): 95 'googlesource' in url):
96 return 'git' 96 return 'git'
97 elif (url.startswith('http://') or url.startswith('https://') or 97 elif (url.startswith('http://') or url.startswith('https://') or
98 url.startswith('svn://') or url.startswith('svn+ssh://')): 98 url.startswith('svn://') or url.startswith('svn+ssh://')):
99 return 'svn' 99 return 'svn'
100 elif url.startswith('file://'):
101 if url.endswith('.git'):
102 return 'git'
103 return 'svn'
100 return None 104 return None
101 105
102 106
103 def CreateSCM(url, root_dir=None, relpath=None, out_fh=None, out_cb=None): 107 def CreateSCM(url, root_dir=None, relpath=None, out_fh=None, out_cb=None):
104 SCM_MAP = { 108 SCM_MAP = {
105 'svn' : SVNWrapper, 109 'svn' : SVNWrapper,
106 'git' : GitWrapper, 110 'git' : GitWrapper,
107 } 111 }
108 112
109 scm_name = GetScmName(url) 113 scm_name = GetScmName(url)
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 new_command.append('--force') 1603 new_command.append('--force')
1600 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1604 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1601 new_command.extend(('--accept', 'theirs-conflict')) 1605 new_command.extend(('--accept', 'theirs-conflict'))
1602 elif options.manually_grab_svn_rev: 1606 elif options.manually_grab_svn_rev:
1603 new_command.append('--force') 1607 new_command.append('--force')
1604 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1608 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1605 new_command.extend(('--accept', 'postpone')) 1609 new_command.extend(('--accept', 'postpone'))
1606 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1610 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1607 new_command.extend(('--accept', 'postpone')) 1611 new_command.extend(('--accept', 'postpone'))
1608 return new_command 1612 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