Commit ce117f61 authored by maruel@chromium.org's avatar maruel@chromium.org

Add --ignore-externals to svn update and svn checkout invocations.

svn:externals are slow to update and are unnecessary in a gclient environment.

TEST=none
BUG=55904

Review URL: http://codereview.chromium.org/3421013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71604 0039d316-1c4b-4281-b951-d872f2087c98
parent 3487f7f4
...@@ -840,10 +840,12 @@ class SVNWrapper(SCMWrapper): ...@@ -840,10 +840,12 @@ class SVNWrapper(SCMWrapper):
for file_status in scm.SVN.CaptureStatus(self.checkout_path): for file_status in scm.SVN.CaptureStatus(self.checkout_path):
file_path = os.path.join(self.checkout_path, file_status[1]) file_path = os.path.join(self.checkout_path, file_status[1])
if file_status[0][0] == 'X': # Temporarily forcibly delete externals to make sure chromium can build
# Ignore externals. # without svn:external's.
logging.info('Ignoring external %s' % file_path) #if file_status[0][0] == 'X':
continue # # Ignore externals.
# logging.info('Ignoring external %s' % file_path)
# continue
if logging.getLogger().isEnabledFor(logging.INFO): if logging.getLogger().isEnabledFor(logging.INFO):
logging.info('%s%s' % (file[0], file[1])) logging.info('%s%s' % (file[0], file[1]))
...@@ -916,7 +918,10 @@ class SVNWrapper(SCMWrapper): ...@@ -916,7 +918,10 @@ class SVNWrapper(SCMWrapper):
def _RunAndGetFileList(self, args, options, file_list, cwd=None): def _RunAndGetFileList(self, args, options, file_list, cwd=None):
"""Runs a commands that goes to stdout and grabs the file listed.""" """Runs a commands that goes to stdout and grabs the file listed."""
cwd = cwd or self.checkout_path cwd = cwd or self.checkout_path
scm.SVN.RunAndGetFileList(options.verbose, args, cwd=cwd, scm.SVN.RunAndGetFileList(
options.verbose,
args + ['--ignore-externals'],
cwd=cwd,
file_list=file_list) file_list=file_list)
@staticmethod @staticmethod
......
...@@ -138,11 +138,11 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -138,11 +138,11 @@ class SVNWrapperTestCase(BaseTestCase):
# Checkout. # Checkout.
gclient_scm.os.path.exists(self.base_path).AndReturn(False) gclient_scm.os.path.exists(self.base_path).AndReturn(False)
files_list = self.mox.CreateMockAnything() files_list = self.mox.CreateMockAnything()
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, gclient_scm.scm.SVN.RunAndGetFileList(
['checkout', self.url, self.base_path, options.verbose,
'--force'], ['checkout', self.url, self.base_path, '--force', '--ignore-externals'],
cwd=self.root_dir, cwd=self.root_dir,
file_list=files_list) file_list=files_list)
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
...@@ -155,10 +155,11 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -155,10 +155,11 @@ class SVNWrapperTestCase(BaseTestCase):
options = self.Options(verbose=True) options = self.Options(verbose=True)
gclient_scm.os.path.isdir(self.base_path).AndReturn(True) gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.scm.SVN.CaptureStatus(self.base_path).AndReturn([]) gclient_scm.scm.SVN.CaptureStatus(self.base_path).AndReturn([])
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, gclient_scm.scm.SVN.RunAndGetFileList(
['update', '--revision', 'BASE'], options.verbose,
cwd=self.base_path, ['update', '--revision', 'BASE', '--ignore-externals'],
file_list=mox.IgnoreArg()) cwd=self.base_path,
file_list=mox.IgnoreArg())
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
...@@ -182,10 +183,11 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -182,10 +183,11 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.exists(file_path2).AndReturn(True) gclient_scm.os.path.exists(file_path2).AndReturn(True)
gclient_scm.os.path.isfile(file_path2).AndReturn(True) gclient_scm.os.path.isfile(file_path2).AndReturn(True)
gclient_scm.os.remove(file_path2) gclient_scm.os.remove(file_path2)
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, gclient_scm.scm.SVN.RunAndGetFileList(
['update', '--revision', 'BASE'], options.verbose,
cwd=self.base_path, ['update', '--revision', 'BASE', '--ignore-externals'],
file_list=mox.IgnoreArg()) cwd=self.base_path,
file_list=mox.IgnoreArg())
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
...@@ -209,10 +211,11 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -209,10 +211,11 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.islink(file_path).AndReturn(False) gclient_scm.os.path.islink(file_path).AndReturn(False)
gclient_scm.os.path.isdir(file_path).AndReturn(True) gclient_scm.os.path.isdir(file_path).AndReturn(True)
gclient_scm.gclient_utils.RemoveDirectory(file_path) gclient_scm.gclient_utils.RemoveDirectory(file_path)
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, gclient_scm.scm.SVN.RunAndGetFileList(
['update', '--revision', 'BASE'], options.verbose,
cwd=self.base_path, ['update', '--revision', 'BASE', '--ignore-externals'],
file_list=mox.IgnoreArg()) cwd=self.base_path,
file_list=mox.IgnoreArg())
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
...@@ -225,8 +228,10 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -225,8 +228,10 @@ class SVNWrapperTestCase(BaseTestCase):
options = self.Options(verbose=True) options = self.Options(verbose=True)
gclient_scm.os.path.isdir(self.base_path).AndReturn(True) gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.scm.SVN.RunAndGetFileList( gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose, ['status'] + self.args, options.verbose,
cwd=self.base_path, file_list=[]).AndReturn(None) ['status'] + self.args + ['--ignore-externals'],
cwd=self.base_path,
file_list=[]).AndReturn(None)
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
...@@ -250,11 +255,11 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -250,11 +255,11 @@ class SVNWrapperTestCase(BaseTestCase):
files_list = self.mox.CreateMockAnything() files_list = self.mox.CreateMockAnything()
gclient_scm.scm.SVN.Capture(['--version'] gclient_scm.scm.SVN.Capture(['--version']
).AndReturn('svn, version 1.5.1 (r32289)') ).AndReturn('svn, version 1.5.1 (r32289)')
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, gclient_scm.scm.SVN.RunAndGetFileList(
['checkout', self.url, self.base_path, options.verbose,
'--force'], ['checkout', self.url, self.base_path, '--force', '--ignore-externals'],
cwd=self.root_dir, cwd=self.root_dir,
file_list=files_list) file_list=files_list)
self.mox.ReplayAll() self.mox.ReplayAll()
scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
relpath=self.relpath) relpath=self.relpath)
...@@ -287,7 +292,7 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -287,7 +292,7 @@ class SVNWrapperTestCase(BaseTestCase):
additional_args = ['--revision', str(file_info['Revision'])] additional_args = ['--revision', str(file_info['Revision'])]
gclient_scm.scm.SVN.Capture(['--version'] gclient_scm.scm.SVN.Capture(['--version']
).AndReturn('svn, version 1.5.1 (r32289)') ).AndReturn('svn, version 1.5.1 (r32289)')
additional_args.append('--force') additional_args.extend(['--force', '--ignore-externals'])
files_list = [] files_list = []
gclient_scm.scm.SVN.RunAndGetFileList( gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose, options.verbose,
...@@ -321,9 +326,13 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -321,9 +326,13 @@ class SVNWrapperTestCase(BaseTestCase):
files_list = self.mox.CreateMockAnything() files_list = self.mox.CreateMockAnything()
gclient_scm.gclient_utils.CheckCallAndFilterAndHeader( gclient_scm.gclient_utils.CheckCallAndFilterAndHeader(
['svn', 'checkout', '--depth', 'empty', self.url, self.base_path], ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path],
always=True, cwd=self.root_dir) always=True,
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, ['update', 'DEPS'], cwd=self.root_dir)
cwd=self.base_path, file_list=files_list) gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose,
['update', 'DEPS', '--ignore-externals'],
cwd=self.base_path,
file_list=files_list)
# Now we fall back on scm.update(). # Now we fall back on scm.update().
gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False) gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False)
...@@ -382,9 +391,13 @@ class SVNWrapperTestCase(BaseTestCase): ...@@ -382,9 +391,13 @@ class SVNWrapperTestCase(BaseTestCase):
files_list = self.mox.CreateMockAnything() files_list = self.mox.CreateMockAnything()
gclient_scm.gclient_utils.CheckCallAndFilterAndHeader( gclient_scm.gclient_utils.CheckCallAndFilterAndHeader(
['svn', 'checkout', '--depth', 'empty', self.url, self.base_path], ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path],
always=True, cwd=self.root_dir) always=True,
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose, ['update', 'DEPS'], cwd=self.root_dir)
cwd=self.base_path, file_list=files_list) gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose,
['update', 'DEPS', '--ignore-externals'],
cwd=self.base_path,
file_list=files_list)
# Now we fall back on scm.update(). # Now we fall back on scm.update().
gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False) gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment