This set of scripts was developed to continuously replicate changes between Perforce and Subversion servers. It is released under the BSD license. Perforce to Perforce replication scripts were based on the code written by Sven Erik Knop.
Features:
- APIs, p4python and pysvn, are used.
- configurable source counter, changeset to stop replication, maximum number of changelists to replicate
- No workspace/working copy need to be created manually
- Only files modified in a change will be updated and submitted.
- symlinks supported
- executable bits are replicated
- svn externals supported
Configuration/command examples can be found in the directory:
./cfg
The scripts are tested in Centos 7. They should be able to work with all Linux distros, provided libs/python modules being installed properly.
To setup environment in Centos 7:
sudo ./setupenv.sh
source buildvenv/bin/activate
Tests are available in the following location:
./test
-
create the test containers, it may take a while:
sudo yum install -y docker sudo systemctl start docker cd test/dockerfiles # "sudo" in case root permission is needed to build Dockerfiles, Or # add user to docker group # # sudo groupadd docker # # sudo usermod -aG docker $USER # log out and in again sudo ./setup_test_dockers.sh
-
New docker containers will be created:
- buildtest_p4d_sampledepot with perforce sample depot, and
- buildtest_svn_sampledepot with a mirror of http://svn.apache.org/repos/asf/bigtop
-
run all tests
# Make sure you are in ./test # If you ran the docker containers setup script, you will need to do: # cd .. python -m unittest discover -f # Ran 204 tests in 4729.528s in my VM.
-
p4p4 replication tests
- testsampledepot_ingroup.py
- testsampledepot_integratemissingchange.py
- testsampledepot_mapping.py
- testsampledepot_misc.py
- testsampledepot_obliterate.py
- testsampledepot.py
- testsampledepot_streams.py
- testsampledepot_unicodeserver.py
-
svnp4 replication tests
- testsvnp4_actions.py
- testsvnp4_exclusion.py
- testsvnp4_wholedir.py
-
p4svn replication tests
- testp4svn_actions.py
- testp4svn_samples.py
Copyright (c) 2016, BigWorld Pty. Ltd.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.