svk

WebHome | UnixGeekTools | Geekfarm | About This Site

Pointers

Info

svk is a decentralized version control system built with the robust Subversion filesystem. It supports repository mirroring, disconnected operation, history-sensitive merging, and integrates with other version control systems, as well as popular visual merge tools. source

It is possible for one person to use SVK as a branch and merge tool while others use subversion on the same project.

Features

Examples

    # create local repository
    svk depotmap --init

    # set up a mirror
    svk mirror https://geektank.selfip.org/svn/myproject/trunk //myproject/trunk

    # check mirrors
    svk mirror --list

    # sync
    svk sync //myproject/trunk

    # create a local branch
    svk mkdir -m "local branches for work on myproject" //myproject/branches
    svk mkdir -m "local branch for work on myproject" //myproject/branches/local
    svk cp //myproject/trunk //myproject/branches/local

    # check it out
    svk co //myproject/branches/local/trunk myproject

Workflow

This is currently incomplete...

From: http://svkbook.elixus.org/nightly/en/svk.tour.cycle.html


    # Update your working copy
    svk sync //myproject/trunk
    # rebase
    svk update
    # both at once
    svk update --sync

    # Make changes
    svk add
    svk delete
    svk copy
    svk move

    # Examine your changes
    svk status
    svk status -u
    svk diff
    svk revert

    # Merge others' changes into your working copy
    svk sync //myproject/trunk
    svk update
    # ... if conflicts, resolve and then ...
    svk resolved .

    # ... run tests ...

    # Commit your changes
    svk commit

    # delivery back to trunk
    # check
    svk smerge -C //myproject/branches/local //myproject/trunk
    # run
    svk smerge -l //myproject/branches/local //myproject/trunk

Subversion clients

It's safe to mirror an svn repository locally, create a local branch using svk, and then work on the local branch using plain old vanilla subversion. This should allow tools that talk subversion but not svk (e.g. eclipse) to work with files in a local mirror. Sweet!

There are some notes about the limitations (which are kinda obvious) at the bottom of this page.

    # sync
    svk sync //myproject/trunk

    # create a local branch
    svk mkdir //myproject/branches/mybranch
    svk cp //myproject/trunk //myproject/branches/mybranch

    # check out the local svk mirror using subversion
    svn co file:///Users/wu/.svk/local/myproject/branches/mybranch myproject

Deleting a working copy

    # set into working copy
    cd /path/to/working_copy

    # tell svk to forget about this working copy
    svk checkout --detach

    # go up a directory and remove the working copy
    cd ../
    rm -rf working_copy

Move repository directory

    # update depotmap
    svk depotmap --relocate  ~/.svk/local /path/svn/mirror
    # manually move the directory
    mv ~/.svk/local/* /path/svn/mirror/

emacs

I use the vc-svk.el module and so far it is working great.

I also wanted to use emacs for my merge tool. I use emacs 22 from fink on OS X, and I run the carbon version in /sw/Applications.

I tried setting SVKMERGE to "Emacs" but it wasn't working. I saw some references about a script called svk-merge-emacs but it no longer existed in the SVK distribution.

It turns out that SVKMERGE looks for an SVK-Resolve class matching the specified value. I checked out the emacs perl lib and found out it was trying to use gnuclient-emacs instead of emacsclient which comes with emacs 22. I changed the command to "emacsclient" but was still having a problem. In the end I realized that when using --eval with emacsclient, each lisp statement must be a separate argument, where as gnuclient allows having them all quoted together as a single argument. So I created a module for emacsclient:

- SVK::Resolve::EmacsClient

Just place the .pm it in the same directory as your SVK/Resolve/Emacs.pm or in your private lib/SVK/Resolve/ and then:

    export SVKMERGE="EmacsClient"




Updated Sat Jan 20, 2007 3:16 PM