11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Server Configuration$ svnsync init http://slave1.example.com/svn-proxy-sync file://var/svn/reposCopied properties for revision 0.$ svnsync init http://slave2.example.com/svn-proxy-sync file://var/svn/reposCopied properties for revision 0.$ svnsync init http://slave3.example.com/svn-proxy-sync file://var/svn/reposCopied properties for revision 0.# Perform the initial replication$ svnsync sync http://slave1.example.com/svn-proxy-syncTransmitting file data ....Committed revision 1.Copied properties for revision 1.Transmitting file data .......Committed revision 2.Copied properties for revision 2.…$ svnsync sync http://slave2.example.com/svn-proxy-syncTransmitting file data ....Committed revision 1.Copied properties for revision 1.Transmitting file data .......Committed revision 2.Copied properties for revision 2.…$ svnsync sync http://slave3.example.com/svn-proxy-syncTransmitting file data ....Committed revision 1.Copied properties for revision 1.Transmitting file data .......Committed revision 2.Copied properties for revision 2.…After this is done, we configure the master server's post-commit hook script to invokesvnsync on each slave server:#!/bin/sh# Post-commit script to replicate newly committed revision to slavessvnsync sync http://slave1.example.com/svn-proxy-sync > /dev/null 2>&1svnsync sync http://slave2.example.com/svn-proxy-sync > /dev/null 2>&1svnsync sync http://slave3.example.com/svn-proxy-sync > /dev/null 2>&1The extra bits on the end of each line aren't necessary, but they're a sneaky way to allowthe sync commands to run in the background so that the <strong>Subversion</strong> client isn't left waitingforever for the commit to finish. In addition to this post-commit hook, you'll need a postrevprop-changehook as well so that when a user, say, modifies a log message, theslave servers get that change also:#!/bin/sh# Post-revprop-change script to replicate revprop-changes to slavesREV=${2}svnsync copy-revprops http://slave1.example.com/svn-proxy-sync ${REV} > /dev/nulsvnsync copy-revprops http://slave2.example.com/svn-proxy-sync ${REV} > /dev/nulsvnsync copy-revprops http://slave3.example.com/svn-proxy-sync ${REV} > /dev/nulThe only thing we've left out here is what to do about locks. Because locks are strictly enforcedby the master server (the only place where commits happen), we don't technically184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!