Plan of implementation
In order to make SVK work, the plan is to mirror the central repository in the local machine. Then the local branch is created. Instead of using the mirrored trunk, user will be accessing this branch. At the end of the day, when everybody is done with their work, the local branch is merged into mirrored trunk. At the same time, the central repository is automatically updated.
Installing SVK
SVK is written completely in Perl and kind of pain to install. Luckily, in my Fedora Core 4 system, Subversion was already installed with perl binding, all I needed to fire the command;
perl -MCPAN -e 'install SVK'This command install SVK and all of it's many dependencies.
Setting up local 'depotmap'
To set up local repository, the following command does the trick;
svk depotmap --initThis will create a default depotmap. Alternatively, if you want to make a depotmap to the desire location, just issue the command
svk depotmapThis will open a default text editor and let you edit the depotmap name and the location.
Mirroring the central repository
svk mirror svn://mydomain.com/myproject/trunk //localrepo/trunkTo ensure that mirror has been setup,
svk mirror --list
command can be used. Now that the mirror has been set up, the local copy is sync with mirror using
svk sync //localrepo/trunkCreating a local branch
The first thing need to be done before start working is to create a local branch. Doing this is same as in Subversion.
svk cp -m "local branch" //localrepo/trunk /localrepo/localbranchYou can check the branch by issuing the following command;
svk ls //localrepo/localbranchNow user is able to work with the local branch using TortoiseSVN or anyother Subversion client tool.
Merging from local branch to the mirror
At the end of the day, after everybody is done with the work, local branch must be merged to the mirror. This can be done with the command svk smerge
command.
svk smerge -C //localrepo/localbranch //localrepo/trunkThe C option checks for the conflict that may have. Now, if there is no conflict, the actual merger can be done using following command;
svk smerge -l //localrepo/localbranch //localrepo/trunkThis command also updates the repository automatically that the mirror points to.