From 8027163652ed32fdc467542fd80bf7056ca4c1fb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 20 Mar 2017 11:03:08 -0700 Subject: Remove deprecated tool Subversion --- src/CHANGES.txt | 2 +- src/engine/SCons/Tool/Subversion.py | 70 ------------ src/engine/SCons/Tool/Subversion.xml | 135 ---------------------- src/engine/SCons/Tool/__init__.py | 2 - test/Deprecated/SourceCode/Subversion.py | 186 ------------------------------- 5 files changed, 1 insertion(+), 394 deletions(-) delete mode 100644 src/engine/SCons/Tool/Subversion.py delete mode 100644 src/engine/SCons/Tool/Subversion.xml delete mode 100644 test/Deprecated/SourceCode/Subversion.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 26018a2..50a5bec 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -30,7 +30,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fixed SCons.Tool.Packaging.rpm.package source nondeterminism across builds. From William Deegan: - - Removed deprecated source code tool CVS, Perforce, BitKeeper, RCS, SCCS. + - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion. From Daniel Moody: - Fixed msvs.py for Visual Studio generated projects which were diff --git a/src/engine/SCons/Tool/Subversion.py b/src/engine/SCons/Tool/Subversion.py deleted file mode 100644 index f1b3708..0000000 --- a/src/engine/SCons/Tool/Subversion.py +++ /dev/null @@ -1,70 +0,0 @@ -"""SCons.Tool.Subversion.py - -Tool-specific initialization for Subversion. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - -# __COPYRIGHT__ -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -import os.path - -import SCons.Action -import SCons.Builder -import SCons.Util - -def generate(env): - """Add a Builder factory function and construction variables for - Subversion to an Environment.""" - - def SubversionFactory(repos, module='', env=env): - """ """ - # fail if repos is not an absolute path name? - import SCons.Warnings as W - W.warn(W.DeprecatedSourceCodeWarning, """The Subversion() factory is deprecated and there is no replacement.""") - if module != '': - module = os.path.join(module, '') - act = SCons.Action.Action('$SVNCOM', '$SVNCOMSTR') - return SCons.Builder.Builder(action = act, - env = env, - SVNREPOSITORY = repos, - SVNMODULE = module) - - env.Subversion = SubversionFactory - - env['SVN'] = 'svn' - env['SVNFLAGS'] = SCons.Util.CLVar('') - env['SVNCOM'] = '$SVN $SVNFLAGS cat $SVNREPOSITORY/$SVNMODULE$TARGET > $TARGET' - -def exists(env): - return env.Detect('svn') - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/Subversion.xml b/src/engine/SCons/Tool/Subversion.xml deleted file mode 100644 index 7c851b5..0000000 --- a/src/engine/SCons/Tool/Subversion.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - -%scons; - -%builders-mod; - -%functions-mod; - -%tools-mod; - -%variables-mod; -]> - - - - - - - - - - - - - - diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index d9fb601..e44ae34 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -1156,8 +1156,6 @@ def tool_list(platform, env): 'tex', 'latex', 'pdflatex', 'pdftex', # Archivers 'tar', 'zip', - # SourceCode factories - # 'Subversion', ], env) tools = ([linker, c_compiler, cxx_compiler, diff --git a/test/Deprecated/SourceCode/Subversion.py b/test/Deprecated/SourceCode/Subversion.py deleted file mode 100644 index 7ed4b15..0000000 --- a/test/Deprecated/SourceCode/Subversion.py +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env python -# -# __COPYRIGHT__ -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -from __future__ import print_function - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -""" -Test fetching source files from Subversion. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.write('SConscript', """ -Environment(tools = ['Subversion']).Subversion('') -""") - -msg_svn = """The Subversion() factory is deprecated and there is no replacement.""" -warn_svn = test.deprecated_fatal('deprecated-build-dir', msg_svn) -msg_sc = """SourceCode() has been deprecated and there is no replacement. -\tIf you need this function, please contact scons-dev@scons.org""" -warn_sc = test.deprecated_wrap(msg_sc) - -svn = test.where_is('svn') -if not svn: - test.skip_test("Could not find 'svn'; skipping test(s).\n") - -svnadmin = test.where_is('svnadmin') -if not svn: - test.skip_test("Could not find 'svnadmin'; skipping test(s).\n") - -print("Short-circuiting this test until we support Subversion") -test.pass_test() - -test.subdir('Subversion', 'import', ['import', 'sub'], 'work1', 'work2') - -# Set up the Subversion repository. -svnrootpath = test.workpath('Subversion') -svnrooturl = 'file://' + svnrootpath - -test.run(program = svnadmin, arguments = 'create %s' % svnrootpath) - -test.write(['import', 'aaa.in'], "import/aaa.in\n") -test.write(['import', 'bbb.in'], "import/bbb.in\n") -test.write(['import', 'ccc.in'], "import/ccc.in\n") - -test.write(['import', 'sub', 'SConscript'], """\ -Import("env") -env.Cat('ddd.out', 'ddd.in') -env.Cat('eee.out', 'eee.in') -env.Cat('fff.out', 'fff.in') -env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) -""") - -test.write(['import', 'sub', 'ddd.in'], "import/sub/ddd.in\n") -test.write(['import', 'sub', 'eee.in'], "import/sub/eee.in\n") -test.write(['import', 'sub', 'fff.in'], "import/sub/fff.in\n") - -test.run(chdir = 'import', - program = svn, - arguments = 'import %s . foo -m"import foo"' % svnrooturl) - -# Test the most straightforward Subversion checkouts, using the module name. -test.write(['work1', 'SConstruct'], """ -SetOption('warn', 'deprecated-source-code') -def cat(env, source, target): - target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}) -env.Cat('aaa.out', 'foo/aaa.in') -env.Cat('bbb.out', 'foo/bbb.in') -env.Cat('ccc.out', 'foo/ccc.in') -env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) -env.SourceCode('.', env.Subversion(r'%s')) -SConscript('foo/sub/SConscript', "env") -""" % svnrooturl) - -test.subdir(['work1', 'foo']) -test.write(['work1', 'foo', 'bbb.in'], "work1/foo/bbb.in\n") - -test.subdir(['work1', 'foo', 'sub']) -test.write(['work1', 'foo', 'sub', 'eee.in'], "work1/foo/sub/eee.in\n") - -test.run(chdir = 'work1', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ -svn cat %s/foo/sub/SConscript > foo/sub/SConscript -""" % (svnrooturl), - build_str = """\ -svn cat %s/foo/aaa.in > foo/aaa.in -cat("aaa.out", "foo/aaa.in") -cat("bbb.out", "foo/bbb.in") -svn cat %s/foo/ccc.in > foo/ccc.in -cat("ccc.out", "foo/ccc.in") -cat("all", ["aaa.out", "bbb.out", "ccc.out"]) -svn cat %s/foo/sub/ddd.in > foo/sub/ddd.in -cat("foo/sub/ddd.out", "foo/sub/ddd.in") -cat("foo/sub/eee.out", "foo/sub/eee.in") -svn cat %s/foo/sub/fff.in > foo/sub/fff.in -cat("foo/sub/fff.out", "foo/sub/fff.in") -cat("foo/sub/all", ["foo/sub/ddd.out", "foo/sub/eee.out", "foo/sub/fff.out"]) -""" % (svnrooturl, svnrooturl, svnrooturl, svnrooturl))) - -test.fail_test(test.read(['work1', 'all']) != "import/aaa.in\nwork1/foo/bbb.in\nimport/ccc.in\n") - -test.fail_test(test.read(['work1', 'foo', 'sub', 'all']) != "import/sub/ddd.in\nwork1/foo/sub/eee.in\nimport/sub/fff.in\n") - -# Test Subversion checkouts when the module name is specified. -test.write(['work2', 'SConstruct'], """ -SetOption('warn', 'deprecated-source-code') -def cat(env, source, target): - target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() -env = Environment(BUILDERS={'Cat':Builder(action=cat)}) -env.Cat('aaa.out', 'aaa.in') -env.Cat('bbb.out', 'bbb.in') -env.Cat('ccc.out', 'ccc.in') -env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) -env.SourceCode('.', env.Subversion(r'%s', 'foo')) -SConscript('sub/SConscript', "env") -""" % svnrooturl) - -test.write(['work2', 'bbb.in'], "work2/bbb.in\n") - -test.subdir(['work2', 'sub']) -test.write(['work2', 'sub', 'eee.in'], "work2/sub/eee.in\n") - -test.run(chdir = 'work2', - arguments = '.', - stdout = test.wrap_stdout(read_str = """\ -svn cat %s/foo/sub/SConscript > sub/SConscript -""" % (svnrooturl), - build_str = """\ -svn cat %s/foo/aaa.in > aaa.in -cat("aaa.out", "aaa.in") -cat("bbb.out", "bbb.in") -svn cat %s/foo/ccc.in > ccc.in -cat("ccc.out", "ccc.in") -cat("all", ["aaa.out", "bbb.out", "ccc.out"]) -svn cat %s/foo/sub/ddd.in > sub/ddd.in -cat("sub/ddd.out", "sub/ddd.in") -cat("sub/eee.out", "sub/eee.in") -svn cat %s/foo/sub/fff.in > sub/fff.in -cat("sub/fff.out", "sub/fff.in") -cat("sub/all", ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) -""" % (svnrooturl, svnrooturl, svnrooturl, svnrooturl))) - -test.fail_test(test.read(['work2', 'all']) != "import/aaa.in\nwork2/bbb.in\nimport/ccc.in\n") - -test.fail_test(test.read(['work2', 'sub', 'all']) != "import/sub/ddd.in\nwork2/sub/eee.in\nimport/sub/fff.in\n") - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12