[nycbug-talk] Notes for the meeting about Subversion of 7 Feb

Ivan "Rambius" Ivanov rambiusparkisanius at gmail.com
Mon Feb 5 16:26:05 EST 2007


Hello Jerry,

On 2/5/07, Jerry B. Altzman <jbaltz at 3phasecomputing.com> wrote:
> on 2007-02-05 15:10 Ivan "Rambius" Ivanov said the following:
> > I am currently preparing my notes for the Subversion presentation on 7
> > Feb. I started to upload my notes and I thought you might want to see
> > them in advance, although they are not fully complete. The link is
> > http://vania.sourceforge.net/svnnotes-en/.
>
> As a very heavy-duty SVN user and someone who supports it for a living,
> my favorite topic to include is "how to do an in-place import of a
> active directory".

If I understand correctly you have a directory on your local
filesystem and you want to add its content to a Subversion repository.
I assume that you want to store the config files for your machine

Usually this is done using svn import, but the problem here is that
after you import it, you have to check out the new copy and delete the
old one. If the directory contains important files like configurations
for a server, it is not wise to risk with a delete. For example, I
store my Apache configuration files in a Subversion repository and I
added /usr/local/etc/httpd in it in the following way:

$ svn mkdir http://my-svn-server/my-repo/usr
$ svn mkdir http://my-svn-server/my-repo/usr/local
$ svn mkdir http://my-svn-server/my-repo/usr/local/etc
$ svn mkdir http://my-svn-server/my-repo/usr/local/etc/apache

This creates the directories directly on the repostory; it does not
touch your local filesystem.

After I have created the directory structure in the repository, I do

$ svn co http://my-svn-server/my-repo/usr/local/etc/apache /usr/local/etc/apache

At this point /usr/local/etc/apache is under svn control. Now I decide
which files from it I want to be versioned, for example httpd.conf is
a perfect candidate:

$ cd /usr/local/etc/apache
$ svn add httpd.conf
$ svn commit -m "original httpd.conf" httpd.conf

Now, httpd.conf is under version control and every time I change it, I
check it in.

Regards
Ivan

-- 
Tangra Mega Rock: http://www.radiotangra.com



More information about the talk mailing list