Everything's possible :)
EDIT haste never leads to quality nor did my answer, missing all the Windows references in the question. So here's a run down on how to get the sync working on Windows.
You have 2 Machines in this case:
- Machine A: where the repository runs
now.
- Machine B: where you'd like to
sync to.
Create a new repository on B that you wish to sync to from A. It's very important that this repository is blank (running on rev0).
On B, in the SVN folder of the newly created repos, browse to /hooks and create the following bat files:
start-commit.bat
IF "%2" == "someusername" (goto :label1) else (echo "Only the someusername account may commit new revisions" >&2 )
exit 1
goto :eof
:label1
exit 0
pre-revprop-change.bat
IF "%3" == "someuser" (goto :label1) else (echo "Only the someuser user may change revision properties" >&2 )
exit 1
goto :eof
:label1
exit 0
someuser
being a syncuser that exists in machineA's repos and is the only user with rights in machineB's repository. It's very important no commits are done manually to machineB's repository.
In the /hooks folder of the repository on machine A
post-commit.bat
CD PATH_TO_SUBVERSION\bin
svnsync sync svn://machineB/repos --non-interactive --no-auth-cache --source-username machineAusername --source-password machineApassword --sync-username machineBusername --sync-password machineBpassword
Once these bats are in place we need to tell the repository on B we want to sync to it:
svnsync initialize svn://
machineB/repos svn://
machineA/repos --non-interactive --no-auth-cache --source-username
machineAusername --source-password
machineApassword --sync-username
machineBusername --sync-password
machineBpassword
which should return something like: Copied properties for revision 0.
Now every time you commit into the repository on machine A it will be copied over to machine B's repository.
It's very important to note that if you want to sync to googlecode or another online repository that they commit a trunk/branches/tags structure into revision 1. You have to contact them to reset the repository if you wish to use these 3rd party repository location as the sync repository.
To give credit where due i copied the pre-revprop-change.bat and start-commit.bat from http://www.svnforum.org/2017/viewtopic.php?t=5745&sid=06551a22d9c0b5780cf1faab6b0e8ce9
I just implemented this myself on a test repository and seems to work like a charm. I'm glad i noticed this question though svnsync has sunk too deep down in my skull. I meant to do set it up when setting up svn at work. So i know what the first thing is i'll be doing at work tomorrow, thanks for that!
EDIT 2:
If you like me have tons of repositories this generic post-commit.bat might appeal to you:
SET REPOS=%1
SET REV=%2
SET REPOS=%REPOS:D:\SVN=%
CD "C:\Program Files\Subversion\bin"
svnsync sync svn://machineB/%REPOS%-sync --non-interactive --no-auth-cache --source-username usernameA --source-password passwordA --sync-username usernameB --sync-password passwordB
This catches the repository name and uses it to dynamically determine the sync URL. i suffixed all my sync repositories on machine B with -sync for clarity. The D:\SVN bit is the svnserve root on machineB eventhought this generic bat file should be placed in the /hooks of machineA's svnserve root.