aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-02-28 05:49:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-02-28 05:49:19 +0200
commit14fef926378adcb921f2650136b49e62d8a94876 (patch)
tree9f9d5f9d0bad254de2627ef83f295dc05cf3aeb7
parent9242f51e0f24b930164dce3f24aeb08b25a9ae39 (diff)
downloadvcsync-14fef926378adcb921f2650136b49e62d8a94876.tar.gz
vcsync-14fef926378adcb921f2650136b49e62d8a94876.tar.bz2
Introduce named configuration blocks
Named configuration blocks allow the user to keep several configurations in a single configuration file. This is useful when several different repositories are used for synchronization. * src/cmdline.opt: New option --name: selects the named configuration to use. * src/config.c (cfg_debug_level,cfg_vcs_command) (cfg_repository_root,cfg_destination_root) (cfg_timeout,cfg_detach,cfg_sleep) (cfg_message): Remove. (default_config,config,config_name): New globals. New configuration block statement "config". * src/cvs.c: Use configuration data from the config variable. * src/doinstrc.c: Likewise. * src/runcmd.c: Likewise. * src/svn.c: Likewise. * src/vcsync.c: Likewise. * src/vcsync.h: Likewise. * tests/namedconf00.at: New file * tests/Makefile.am: Add new file * tests/testsuite.at: Include namedconf00.at * tests/cvscom02.at: Fix typo in the setup string
-rw-r--r--tests/namedconf00.at71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/namedconf00.at b/tests/namedconf00.at
new file mode 100644
index 0000000..cf56df8
--- /dev/null
+++ b/tests/namedconf00.at
@@ -0,0 +1,71 @@
+# This file is part of Vcsync testsuite. -*- Autotest -*-
+# Copyright (C) 2014 Sergey Poznyakoff
+#
+# Vcsync is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Vcsync is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Vcsync. If not, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([named configuration])
+AT_KEYWORDS([cvs cvscom namedconf namedconf00])
+
+AT_CHECK([
+AT_VCS_PREREQ(CVS)
+cwd=$(pwd)
+
+mkdir test repo home repo/test
+
+# Create configuration file
+cat > vcsync.conf <<EOT
+detach yes;
+sleep 2;
+vcs-type cvs;
+repository-root $cwd/a;
+destination-root $cwd/b;
+config x {
+ detach yes;
+ sleep 2;
+ vcs-type cvs;
+ repository-root $cwd/repo;
+ destination-root $cwd/home;
+}
+EOT
+
+# Initialize repository
+CVS_REPO_INIT($cwd/repo/test, $cwd/vcsync.conf, x)
+
+# Create working directory
+cd test
+echo "README file" > README
+mkdir dir
+echo "text" > dir/file
+
+set -e
+
+# Do initial import
+$CVS_BIN -Q -d $cwd/repo/test import -m 'Initial import' test test start 2>../err >/dev/null
+sed "s|$cwd||" ../err >&2
+
+sleep 3
+cd ../
+rm -rf test
+$CVS_BIN -Q -d $cwd/repo/test co test >/dev/null
+
+cd test
+echo "README update" > README
+$CVS_BIN -Q commit -m 'update' > /dev/null
+sleep 3
+diff README ../home/test/README
+],
+[0])
+
+AT_CLEANUP
+

Return to:

Send suggestions and report system problems to the System administrator.