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

Side by Side Diff: gclient_scm.py

Issue 2837001: Make each solution dictionary an object. (Closed)
Patch Set: Include a fix in GetScmName() Created 10 years, 6 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 | « gclient.py ('k') | 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) 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 # Factory Method for SCM wrapper creation 56 # Factory Method for SCM wrapper creation
57 57
58 def GetScmName(url): 58 def GetScmName(url):
59 if url: 59 if url:
60 url, _ = gclient_utils.SplitUrlRevision(url) 60 url, _ = gclient_utils.SplitUrlRevision(url)
61 if (url.startswith('git://') or url.startswith('ssh://') or 61 if (url.startswith('git://') or url.startswith('ssh://') or
62 url.endswith('.git')): 62 url.endswith('.git')):
63 return 'git' 63 return 'git'
64 elif (url.startswith('http://') or url.startswith('https://') or 64 elif (url.startswith('http://') or url.startswith('https://') or
65 url.startswith('svn://') or url.startswith('ssh+svn://')): 65 url.startswith('svn://') or url.startswith('svn+ssh://')):
66 return 'svn' 66 return 'svn'
67 return None 67 return None
68 68
69 69
70 def CreateSCM(url, root_dir=None, relpath=None): 70 def CreateSCM(url, root_dir=None, relpath=None):
71 SCM_MAP = { 71 SCM_MAP = {
72 'svn' : SVNWrapper, 72 'svn' : SVNWrapper,
73 'git' : GitWrapper, 73 'git' : GitWrapper,
74 } 74 }
75 75
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 command should be a list of strings that represents an svn command. 928 command should be a list of strings that represents an svn command.
929 929
930 This method returns a new list to be used as a command.""" 930 This method returns a new list to be used as a command."""
931 new_command = command[:] 931 new_command = command[:]
932 if revision: 932 if revision:
933 new_command.extend(['--revision', str(revision).strip()]) 933 new_command.extend(['--revision', str(revision).strip()])
934 # --force was added to 'svn update' in svn 1.5. 934 # --force was added to 'svn update' in svn 1.5.
935 if options.force and scm.SVN.AssertVersion("1.5")[0]: 935 if options.force and scm.SVN.AssertVersion("1.5")[0]:
936 new_command.append('--force') 936 new_command.append('--force')
937 return new_command 937 return new_command
OLDNEW
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698