Getting going with SVK

jdavidb on 2008-04-04T16:24:01

I mentioned awhile back I was going to start using SVK while our repository at work is CVS. After a couple of false starts, I've really started to use SVK this week. It's already helping me, but I'm having some problems from lack of knowledge.

SVK and CVS integration isn't perfect at this point (where "perfect" would be that SVK can mirror a CVS repository the way it can a Subversion repository, and I could use SVK to push to it and pull from it seamlessly), so basically you check out a CVS working copy and then track that CVS copy as it changes in SVK. This gives some headaches, but actually this alone has helped me in several ways.

I think what I want to do is have a branch that tracks the CVS trunk, and then one or more local branches for development. I have some local changes I want to have all the time but not commit, and I think I want that to be my trunk and everything else to be a branch off of that. I want to update my CVS trunk periodically, then pull those changes down to my trunk at times that are sensible for me. When I want to commit changes I want to push them into the CVS trunk from the downstream branch, and then push them back from there into CVS.

I sort of got this working yesterday, and it was very nice. I tested several times pulling CVS changes into my CVS trunk, then using smerge to pull them into my working trunk. Nice. I was excited.

And then I tried to do some work in my trunk and pull it back into CVS trunk. Crash! I ran headlong into a knowledge problem. I know how to execute "take all of the changes in this branch and pull them into that branch." But I cannot figure out how to execute "take some of the changes in this branch and pull them into that branch." So I've got files modified in the working trunk, and I don't want to pull the changes to those files into the CVS trunk, but I don't know how to merge the changes from just some of the files.

I've tried to view the docs on the merge, cmerge, and smerge commands to figure out how to do this. I suspect it's the merge command, but I just can't get the syntax right even looking at the help. I've tried looking through the SVK book, but it's very much a work in progress and doesn't seem to be helping me.

If anyone can tell me what command I should be using and how to execute it, that would be great. I'm not posting the commands I've tried or the error messages because I really think I was barking up the wrong tree and the commands I executed would just confuse knowledgeable SVK users as to what I was actually trying to do. The commands I typed probably don't even come close to matching the prose description above. :) But if error messages can help someone who's willing to take the time to help me, I'll post them.

I am willing to listen to "Use git; you won't have to deal with this." :)

Update: I just now found out I can use svk push and svk pull to move some stuff between branches, but it still doesn't seem to have a provision for moving the changes to only some files.

Update: Here's where the question was asked on the svk-users mailing list. I can't see if it was answered anywhere. The svk-devel list seems to be the better place for questions, but I don't see it asked there anywhere. I may ask there myself next week. Or I may try a git trial. For now I'm stuck with a single branch into which I pile both my local changes and pull updates from cvs.


Use git; you won't have to deal with this.

mugwumpjism on 2008-04-05T00:28:09

There are at least three functional ways to get from CVS to git listed on the Interfaces, Front-ends And Tools page on the git wiki.

If you want to be able to commit back to cvs, you probably want to go the git-cvsimport / git-cvsexportcommit route.

Re:Use git; you won't have to deal with this.

jdavidb on 2008-04-07T13:05:51

Thanks. I'll definitely look more into it.

I came into work this morning to discover our CVS server has a kernel panic; one of the only two guys who can fix it didn't arrive till just now, so at the moment I can't really use much of anything. :) Actually I can continue to commit to my SVK repository; just can't get all the updates that happened after I went home on Friday and over the weekend.

Re:Use git; you won't have to deal with this.

jdavidb on 2008-04-07T16:12:12

Thanks again. A little bit of reading, study, and practice, and now I see that git does in fact handle my gripe above quite nicely. Score 1 for git, 0 for svk, which disappoints me, because to be honest I'm biased in favor of svk. :)

I love that with git I can take a long time specifically marking what I actually want to commit and that when I commit, unless I make an unconscious habit of using the -a option, I'll just commit the things I marked rather than possibly screwing up and committing everything! Score 1 for git over cvs, svn, and svk. Wow.

I think git is going to end up being my final destination.