From 4b801564641e2d83113cb1caffd3c633db30616c Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Tue, 7 Oct 2003 12:24:48 +0000 Subject: [PATCH] Patch by Martin Furter: Automatic properties for 'svn add' and 'svn import' added (issue #1502). * build.conf ([fs-test-scripts]): Added autoprop_tests.py * subversion/include/svn_config.h (SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, SVN_CONFIG_SECTION_AUTO_PROPS): New defines. * subversion/libsvn_wc/adm_ops.c (svn_wc_add): Removed mimetype/executable detection. * subversion/libsvn_subr/config_file.c (svn_config_ensure): Config entries added. * subversion/libsvn_client/client.h (svn_client__get_auto_props): Prototype added. * subversion/libsvn_client/commit.c (import_file): Call svn_client__get_auto_props and set the properties, detection of mimetype and executable removed. * subversion/libsvn_client/add.c (auto_props_baton_t): New struct, local usage only. (auto_props_enumerator): New function, used by svn_client__get_auto_props. (svn_client__get_auto_props): New function, searches automatic properties in the config, detects mimetype/executable if needed. (add_file): New function, adds a file with automatic properties and calls notify_func. (add_dir_recursive, add): When adding a file call add_file() instead of svn_wc_add(). * subversion/clients/cmdline/cl.h (svn_cl__longopt_t): Added svn_cl__autoprops_opt and svn_cl__no_autoprops_opt. (svn_cl__opt_state_t): Added autoprops and no_autoprops. * subversion/clients/cmdline/main.c (svn_cl__options, svn_cl__cmd_table): Added svn_cl__autoprops_opt and svn_cl__no_autoprops_opt. (main): Process svn_cl__autoprops_opt and svn_cl__no_autoprops_opt and overwrite SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS. * subversion/tests/clients/cmdline/autoprop_tests.py New file containing tests for auto-props. * subversion/tests/clients/cmdline/svntest/main.py Added default_config_dir, set_config_dir() and reset_config_dir(). (run_one_test): Added call to reset_config_dir() git-svn-id: http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/clients/cmdline@847395 13f79535-47bb-0310-9956-ffa450edef68 --- svntest/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/svntest/main.py b/svntest/main.py index e5a477f..6b77ac5 100644 --- a/svntest/main.py +++ b/svntest/main.py @@ -127,6 +127,7 @@ temp_dir = 'local_tmp' pristine_dir = os.path.join(temp_dir, "repos") greek_dump_dir = os.path.join(temp_dir, "greekfiles") config_dir = os.path.abspath(os.path.join(temp_dir, "config")) +default_config_dir = config_dir # @@ -226,6 +227,20 @@ def run_command(command, error_expected, binary_mode=0, *varargs): return stdout_lines, stderr_lines +def set_config_dir(cfgdir): + "Set the config directory." + + global config_dir + config_dir = cfgdir + +def reset_config_dir(): + "Reset the config directory to the default value." + + global config_dir + global default_config_dir + + config_dir = default_config_dir + # For running subversion and returning the output def run_svn(error_expected, *varargs): """Run svn with VARARGS; return stdout, stderr as lists of lines. @@ -442,6 +457,7 @@ def run_one_test(n, test_list): exit_code = tc.run(args) if sandbox is not None and not exit_code and cleanup_mode: sandbox.cleanup_test_paths() + reset_config_dir() return exit_code def _internal_run_tests(test_list, testnum=None): -- 2.11.4.GIT