Tue 15 Aug 2006
As promised, a discussion of how to use SVK’s pull command:
For the longest time, I would type some variation of
$ svk sync //$project_name/main $ svk sm //$project_name/main //$project_name/local $ cd ~/src/$project_name $ svk update
in order to pull changes from a remote repository to the mirror, merge from the mirror to my local branch, then update my working copy from the local branch.
That much typing sucks, and it was just as I was getting ready to write a macro for this task (in the vein of mymerge and mergeproject) that I discovered svk push. This lead me to investigate pull, which is — as you might have guessed — the opposite of push.
At its core, pull can be thought of as a wrapper around that command sequence above: sync the mirror, merge to the local branch, then update the working copy. The simplest form of pull is this, issued from within a working copy:
svk pull
Like push, you can provide your own working copy path:
svk pull ~/src/project_x/
This has the same effect as if you had cd‘d to the directory and then run the naked pull command.
Also like push, you can provide a depot path instead of a working copy path:
svk pull //project_x/local
This will sync the mirror and merge the new changes, but will not update any working copy.
I’ve been using push and pull for a few weeks now, and I’m thrilled by not having to type out a thousand commands over and over again or write a new macro.