Add the --nosvn property to the chromium solution.
This allows non-committers to use fetch to checkout chromium or blink using
$ fetch chromium --nosvn=true
BUG=230357
R=dpranke@chromium.org
Review URL: https://codereview.chromium.org/13910005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@193713 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/fetch.py b/fetch.py
index 80dcce9..1e5d688 100755
--- a/fetch.py
+++ b/fetch.py
@@ -83,33 +83,20 @@
return subprocess.check_call(('svn',) + cmd, **kwargs)
-class GclientGitSvnCheckout(GclientCheckout, GitCheckout, SvnCheckout):
+class GclientGitCheckout(GclientCheckout, GitCheckout):
def __init__(self, dryrun, spec, root):
- super(GclientGitSvnCheckout, self).__init__(dryrun, spec, root)
+ super(GclientGitCheckout, self).__init__(dryrun, spec, root)
assert 'solutions' in self.spec
keys = ['solutions', 'target_os', 'target_os_only']
gclient_spec = '\n'.join('%s = %s' % (key, self.spec[key])
for key in self.spec if key in keys)
self.spec['gclient_spec'] = gclient_spec
- assert 'svn_url' in self.spec
- assert 'svn_branch' in self.spec
- assert 'svn_ref' in self.spec
def exists(self):
return os.path.exists(os.path.join(os.getcwd(), self.root))
def init(self):
- # Ensure we are authenticated with subversion for all submodules.
- git_svn_dirs = json.loads(self.spec.get('submodule_git_svn_spec', '{}'))
- git_svn_dirs.update({self.root: self.spec})
- for _, svn_spec in git_svn_dirs.iteritems():
- try:
- self.run_svn('ls', '--non-interactive', svn_spec['svn_url'])
- except subprocess.CalledProcessError:
- print 'Please run `svn ls %s`' % svn_spec['svn_url']
- return 1
-
# TODO(dpranke): Work around issues w/ delta compression on big repos.
self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G')
@@ -127,6 +114,28 @@
cwd=wd)
self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd)
+
+class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout):
+
+ def __init__(self, dryrun, spec, root):
+ super(GclientGitSvnCheckout, self).__init__(dryrun, spec, root)
+ assert 'svn_url' in self.spec
+ assert 'svn_branch' in self.spec
+ assert 'svn_ref' in self.spec
+
+ def init(self):
+ # Ensure we are authenticated with subversion for all submodules.
+ git_svn_dirs = json.loads(self.spec.get('submodule_git_svn_spec', '{}'))
+ git_svn_dirs.update({self.root: self.spec})
+ for _, svn_spec in git_svn_dirs.iteritems():
+ try:
+ self.run_svn('ls', '--non-interactive', svn_spec['svn_url'])
+ except subprocess.CalledProcessError:
+ print 'Please run `svn ls %s`' % svn_spec['svn_url']
+ return 1
+
+ super(GclientGitSvnCheckout, self).init()
+
# Configure git-svn.
for path, svn_spec in git_svn_dirs.iteritems():
real_path = os.path.join(*path.split('/'))
@@ -146,6 +155,7 @@
CHECKOUT_TYPE_MAP = {
'gclient': GclientCheckout,
+ 'gclient_git': GclientGitCheckout,
'gclient_git_svn': GclientGitSvnCheckout,
'git': GitCheckout,
}