How to set up your local SVN mirror (with svk)
Method 1: To have a local subversion repository
The goal is to have one's own subversion repository in order to add branches and changes which do not make sense in the global Foswiki
SVN.
Step 0 Collect/install software
You will need:
Step 1 Setup local svn repository
If you havent already done, create a new repository.
-
# svnadmin create --fs-type fsfs /pathtonew/repos
-
# svnserve -d -r /pathtonew/repos
Step 2 Setup local svk depots
If you setup svk for the first time, create a new depot
Step 3 Setup local svn structure
- Create a new folder (i.e. /mytwiki) in your local svn repository. Would somebody please add the svn command here.
Step 4 Link up
Step 5 Mirror
-
$ svk sync //twiki.org
-
$ svk sync //mytwiki.com
This will take quite of long time for the first time.
Step 6 Local Merges
Merge changes from twiki.org to mytwiki.com.
-
$ svk smerge -sIlB //twiki.org //mytwiki.com
This will take quite of long time for the first time, too.
You probably want to add Step 5 and 6 to your crontab.
I never tried to upload changes to twiki.org via this svk setup. I always use a clean checkout from twiki.org.
See also:
http://www.nshb.net/node/71
--
OliverKrueger - 01 Mar 2006
Method 2: Using svk only on the server side, svn on the client side
My approach is similar, but I use svk only on the server side, and then checkout using svn:
Step 1: create an svk depot and use it for the apache svn server
Step 2: create a new mirror
Step 3: to create a local copy of a mirror, and then to merge changes from the mirror to it
- svk cp //mirror/project //local/myprojectbranch
- svk sync //mirrors/project
- svk smerge //mirrors/project //local/myprojectbranch
- (or in an svk checkout of the branch, run svk up -sm
Step 4: Syncronize
Put
svk sync -all
into a cronjob
Step 5: Merge to the local branch from twiki.org
svk smerge //mirrors/twiki.org/twiki/trunk //local/TWikiTrunk -m "update from svn.twiki.org"
--
SvenDowideit - 01 Mar 2006
Method 3: svk on the client side
This is the only method available is you only want to work with one or two branches, and don't want to have the whole repo history in your mirror (
svk sync --skipto REV
fails if used on a mirror that points to a branch instead of the root of the svn repo)
Step 1: Create a svn checkout area
mkdir remotes
cd remotes
svn co http://svn.twiki.org/svn/twiki/trunk
Step 2: Import your checkout area into a local svk depot
(from the remotes directory)
svk import -t trunk //remotes/trunk
(might take a while)
Step 3: Create a working branch
svk copy //remotes/trunk //local/myfeature
mkdir local
cd local
svk co //local/myfeature
Step 4: Sync with official repo
(from the remotes/trunk directory)
svn up
svk ci --message "twiki.org sync"
Step 5: Sync your branch
(from the local/myfeature)
svk smerge //remotes/trunk
(solve any conflicts)
svk ci --message "merging from twiki.org"
Step 6: Push your changes to twiki.org
Make sure that your branch is already in sync with twiki.org before starting
(from the local/myfeature)
svk ci --message "finished"
svk smerge //local/myfeature //remotes/trunk
(from the remotes/trunk directory)
svn up
svk up
(solve any conflicts and run the tests)
svn ci --message "ItemXXXX: My Feature"
I know, this is quite convoluted, but the whole history for the twiki repo is more than 8 Gb in size.
--
RafaelAlvarez - 25 Sep 2008
Discussion