[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: shadow directory

From: Josh Howe <josh_at_sinu.com>
Date: 2004-09-30 21:39:53 CEST

Ok, I'm almost there. Now I'm running into a problem when trying to export a
single file. I keep getting "attempted to create entry in non-directory
parent"

Here's my export command:
svn export file:///varrepository_path/public_website/trunk/index.html
/var/www/shadow/public_website --force

Any ideas? Thanks.

-----Original Message-----
From: Chris Little [mailto:clittle@sbs.com]
Sent: Wednesday, September 29, 2004 4:16 PM
To: Josh Howe; users@subversion.tigris.org
Subject: Re: shadow directory

>>>Josh Howe wrote:
>>>
>>>In VSS there's a concept called "shadow directories". Basically, you can
>>>set up a physical directory that always mirrors the latest version of
>>>the repository files. When a file is checked in, it is automatically
>>>copied to this folder. Is there anything similar in subversion? Thanks!
>>>
>>>
>>
>> You could use a post-commit hook script to do the copy(as well as many
>> other things). Not as straightforward as VSS, you have to do the work
>> but you get much more flexibility.
>>
>> http://svnbook.red-bean.com/svnbook-1.0/svn-book.html#svn-ch-5-sect-2.1
>>
> Josh Howe wrote:
> Hmm...i'm not sure this will work for me. I need to
> know what file was committed, I don't want to export the entire
> repository every time a file is committed. Especially considering
> that different projects in the repository should go to different
> shadow folders that don't reflect the repository tree. Any ideas?
> Thanks.

Well, this is possible - take a look at the hook scripts included with
subversion. These can give you an idea. The post-commit will get the rep
name and the rev num, so you can use that to figure out what changed in
that rev and then do your export accordingly.

>>>
>>> Thanks for the advice. I'm having a hard time getting it to work.If the
>>> path to the repository is $1, should file://$1 be a valid first argument
>>> to svn export? My script is basically svn export file://$1
>>> path_to_shadow_folder --force. But it isn't working. The script is named
>>> correctly and is executable. Thanks!
>>
>> Test it out by hand first to make sure it works. On my server this seems
>> to work. The main thing to make sure of is that the $1 ends up being an
>> absolute path. You didn't say what the error is, you can try having the
>> script redirect stdout/stderr to a file to see what the command
>> complains about.
>
> Thanks Chris. All $1 gives me is the absolute path to the repository,
> I need the absolute path to a file in the repository, the file that was
> committed. Am I not looking at this the right way?

Like I alluded to above, you will need to take this info along with the
rev and query svn about what changed in that revision on that
repository. Then parse this info and use it to create your export
command(or whatever you want to do). I use the python bindings to do the
query but I believe others also use svnlook(like for websvn I believe).

This communication, including any attachments, is confidential information
of SBS Technologies and intended solely for the use of the individual or
entity to which it is addressed. Any unauthorized review, use, disclosure
or distribution is prohibited. If you believe this message was sent to you
in error, please immediately notify the sender by reply e-mail and delete
this message without disclosing it. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 30 21:40:45 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.