Damon Cortesi's blog

Musings of an entrepreneur.

Home and Back Again With Subversion

| Comments

I had seen a couple articles about keeping your $HOME in subversion, but none of them really walked me through it. They all assumed a pretty good knowledge of subversion. As a former cvs user with no subversion experience whatsoever, I was pretty lost.

# svnadmin create –fs-type fsfs /var/svn/users/userX # chown -R userX /var/svn/users/userX

Ok, now what? I’ve got the repository created… This is where I started to get confused. Joey Hess’ home directory looked normal, but ToyKeeper’s site was talking about trunks and branches. I didn’t know whether those went into the home directory or the repository. I assumed the latter, but I needed an answer. Another ONLamp article indicated that it’s on the repository side. I should probably make the decision of how I want to do that now, but I’m going to hold off until I’m more familiar with subversion.

Upon finding this post about inverting(?) the process of creating a subversion repository, I was able to figure out what to do next.

userX@host ~ $ svn co files:///var/svn/users/userX/ . userX@host ~ $ svn add .zshrc userX@host ~ $ svn ci -m ‘svn test checkin of zsh config file’

…That seemed to work. I’m realizing that the branches usage referred to by ToyKeeper might be very useful. But let’s keep going for now. After updating my .zshrc (it’s a few years old…I’m lazy, what can I say), another checkin and this is easier than I thought.

userX@dipshell ~ $ svn ci -m ‘Removed old items from .zshrc’ Sending .zshrc Transmitting file data . Committed revision 2.

Now, If I want to make this useful I need to enable network access. This has also been a slight point of contention as I must not be reading close enough but svn doesn’t seem too easy to setup over ssh. And I just realized I have another problem - if I check out this base directory on another machine, it will be cluttered with dot files. I’ll have to look into that later.

Well it seems I’m just an idiot - svn over ssh is as simple as just running the command. userX@host2 ~ $ svn list svn+ssh://host/var/svn/users/userX sigh The postinst message from emerge confused me…I thought there were additional steps. Well that makes me happy!

userX@host2 ~ $ svn co svn+ssh://192.168.153.8/var/svn/users/userX/ A userX/.zshrc Checked out revision 2.

Oh no…it checked it out to the userX directory. Adding the location to checkout to solved that, but I need to remove the old file first or I get the following error: userX@host2 ~ $ svn co svn+ssh://192.168.153.8/var/svn/users/userX/ . svn: Failed to add file ‘.zshrc’: object of the same name already exists

Cool, this is no problem. Now I need to figure out how best to organize it so I can pull stuff down from linux, windows, and even osx if the need arises.

Comments