Using SVK for Roaming SVN Users
I have a Trac/SVN server on my work laptop (in a VMWare box). Others are needing access to the files more, so I needed a way to have two way merging. Of course, others have had this problem already, and svk was the result. However, there are certain aspects of svk that I'm not too fond of. Mainly, I didn't want to lose my TortoiseSVN capabilities or all my subversion know-how. However, I'm going to exploit the fact that an svk "depot" is under the hood a svn repository.
Here's what I did:
- I needed to get svk running under Cygwin. That was a real PITA, but luckily, somebody was nice enough to put all the instructions on this wiki page.
- Now I need to get a local copy of the entire svn repository under svk:
svk mkdir svnrepo
svk mirror http://svnserver/svn/path/to/repo //svnrepo/reponame
svk sync -a
(This took FOREVER)svk mkdir local
svk cp //svnrepo/reponame //local/reponame
OK, so now, we have a local svk "depot" which has in it /svnrepo/
and /local/
but it is all kept in a single svn repository on your hard drive. Now, the magic: we check out from that file using TortoiseSVN to create a subversion working copy. Using TortoiseSVN, I checked out "from" file:///E:/cygwin/home/user/.svk/local/local/reponame
- you'll note that the first part is my cygwin home directory (username of 'user'), and the double local
is not a typo - the first is a "real" directory on my E: drive, the second is at the root level of the repository (that we made above).
Now, when I'm offline, I can just use my local working copy, and am able to check in as much as I want without any worries. Another use for this I read about was if you want to check in a lot more than your coworkers do and want to keep the "master" repository "clean."
To perform the actual sync with the master server:
svk pull //local/reponame
(This makes sure the local svk depot is in sync)svk push --verbatim //local/reponame
- The
verbatim
flag prevents svk from inserting its own header which was causing problems with trac by pointing to revision numbers in the future which just made no sense.
- The
Drawbacks
- One of the files I tried to
push
was locked on the master repository, but that information doesn't seem to be propagated properly, so the push failed until I unlocked the file manually on the master server. - Need to do the
push
andpull
manually. - svn's keyword substitution now replaces info with local information, like revision number of the file in the local svk depot, not the master repository (which means printouts aren't going to match). - It seems that all svn properties may be iffy.