documentation:svk
=>  Releases

Current version
Git/Latestdiff: 1.5.6

Latest Snapshots
Produced after each commit or rebase to new upstream version

GIT
RSBAC source code, can be unstable sometimes

=>  Events

No events planned

This is an old revision of the document!


What is SVK

SVK is available from http://svk.elixus.org/ It is a “distributed” Version Control tool. It uses FSFS from SVN as it's sublayer. From a 10,000 feet view, SVK allows to checkout any SVN/CVS/Perforce/Git repository to your local machine and commit/checkout remotely and locally, then submit the changes when you are done. So, it allows to work offline. And it allows to work on your very own branches, for testing.

From a more technical point of view, SVK is like a repository on your local machine where you have two kinds of sub-repositories: Mirrors of SVN/CVS/… or local branches.

Here's a diagram showing how this little world works: SVK overview diagram.

Getting started, mirroring a repository

So let's initialise where to keep the local repository (the depot):

# svk depotmap --init

You can choose where to put or change the location of this depot with the relocate command:

# svk depotmap --relocate /path/to/somewhere

We will now mirror an existing SVN repository, RSBAC's for instance: Let's create a path just for mirrors. Put whatever you feel like as commit message when asked. optional, just don't specify //mirrors if you don't want to, it's faster not to type it all the time… !

# svk mkdir //mirrors

Now create the mirrored path:

For anonymous mirroring

# svk mirror svn://rsbac.org/rsbac1 //mirrors/rsbac1

For developers with write access

# svn+ssh://<you@>rsbac.org/daten/subversion/rsbac1 //mirrors/rsbac1

And synchronise it:

# svk sync //mirrors/rsbac1

When committing or using this path directly, changes will affect the real SVN repository directly, much like using SVN would do.

Whenever you want to checkout this path, just do it. You can delete the files afterwards and check them out again, or you can simply update then. There will be no “.svn” directories or the like. SVK is just flexible.

Making a local branch, working offline

To work offline or just do your stuff without affecting the repository directly, you've to create a local branch. Once you are done with your work you can commit it to the mirrored path, or create a patch if you have no write access (and send it to us :-)) Basically the repository already lives on your harddrive so just make this branch whenever you are really offline, or have no write access.

So, create a directory for the local branches, and create your branch (example for the 2.6 RSBAC kernel):

# svk mkdir //local
# svk cp //mirrors/rsbac1/linux-kernel/2.6/branches/linux-rsbac //local/26/linux-rsbac"

You can now checkout “//local/26/linux-rsbac”, modify, commit (using “svk commit -S”, please never ever use svn on svk local repository, it would corrupt it.)

Once done, you have to merge back your local branch to the mirrored path (this will commit your changes to the real SVN repository)

# svk smerge //local/26/linux-rsbac //mirrors/rsbac1/linux-kernel/2.6/branches/linux-rsbac

note: ONLY USE push IF YOU KNOW WHAT YOU ARE DOING.

You can also get the changes from the mirror to update your local branch with upstream:

Specify the path even if its optional or I will kill you personally. I'm not kidding.

# svk pull //local/26/linux-rsbac

Signing

If you are a RSBAC developper, please do not forget to sign every commit made to the mirrored path!

Simply add “-S” to every commit, smerge, merge, or other commit-like command.

# svk commit -S myfile.c

You can verify thoses signatures with the verify command

# svk verify -r REVISION

Versionning, diffs, etc.

There are several ways to specify an SVK version. Let's take a look at the log:

# svk log -r HEAD //rsbac1
----------------------------------------------------------------------
r220 (orig r208):  subversion | 2005-09-22 11:08:08 +0200

kang: added possibility to change the default branch (SVKDEFBRANCH=linux-rsbac-1
.2|linux-rsbac)
----------------------------------------------------------------------

r220 is your local SVK revision number. you can use it anytime, but its only yours. r208 is SVN's revision number. If you want to talk about this very change to someone, PLEASE give this revision number.

In short, to see a diff from this change on your system:

# svk diff -r220:219

To see a diff on this change, for anyone, including you:

# svk diff -r208@:207@

See the “@” at the end ? that does the trick.

When diffing a file on your filesystem against the mirrored repository latest's version, you can simply do:

# svk diff -rBASE:HEAD myfile

It will return the changes in the mirrored repository, not yet in your local file.

The reverse, to see what's in your file and not in the repository, is quite easy:

# svk diff myfile

You can also specify revision per date:

# svk log -r {2005-09-22}

Ressources

For more information, see the SVK website, or the very good SVK book.

//
documentation/svk.1134059551.txt.gz · Last modified: 2006/05/02 13:40 (external edit)

documentation/svk.1134059551.txt.gz · Last modified: 2006/05/02 13:40 (external edit)
This website is kindly hosted by m-privacy