You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by rouble <ro...@gmail.com> on 2008/05/31 16:39:53 UTC

Create a read-only always updated working copy

SVN gurus,

I have a tools directory that contains many executable perl scripts:
/path/to/tools

I wanted to add this to svn, so I did this:
~$ svnadmin create /path/to/svn
~$ svn mkdir file:///path/to/svn/trunk -m "Adding trunk"
~$ svn mkdir file:///path/to/svn/branches -m "Adding branches"
~$ svn mkdir file:///path/to/svn/tags -m "Adding tags"
~$ svn mkdir file:///path/to/svn/trunk/tools -m "Adding tools"
~$ svn import /path/to/tools/ file:///path/to/svn/trunk/tools -m
"Initial import"

Now, I have /path/to/tools in my svn repository. So far so good.

Now, I want to pull a read-only always updated working copy in
/path/to/tools. So, users can still cd into /path/to/tools and execute
the perl scripts just like they used to. But users should not be able
to edit any of these files in that working copy.

Also, whenever someone commits something to the repository, I want
/path/to/tools to get automatically updated; so users of the scripts
always have the latest version.

I saw that there is a svnsync tool in svn 1.4+, that can help me
achieve what I want, but we only have svn 1.3.2 installed on our
machines here... and there is no plan of an upgrade anytime soon. Is
there another way to do what I want to do?

tia,
rouble

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

Re: Create a read-only always updated working copy

Posted by rouble <ro...@gmail.com>.
Hi Kevin,

Thanks. I really appreciate the advice.

I moved post-commit.tmpl to an executable post-commit and added the following:
/path/to/bin/svn update /path/to/working/copy/tools

... and it works wonderfully. Except, I now have some permissions
problem, that I will detail in another email to this group.

tia,
rouble

On Sat, May 31, 2008 at 1:07 PM, Kevin Grover <ke...@kevingrover.net> wrote:
> On Sat, May 31, 2008 at 9:39 AM, rouble <ro...@gmail.com> wrote:
>> SVN gurus,
>>
>> I have a tools directory that contains many executable perl scripts:
>> /path/to/tools
>>
>> I wanted to add this to svn, so I did this:
>> ~$ svnadmin create /path/to/svn
>
> Just a note: I would create an empty directory called 'svn' and then
> 'svmadmin create' a repository called 'tools' there (svnadmin create
> /path/to/svn/tools).  This way, you can add new repositories at any
> time.  This is personal preference, the rest of my response will be
> based on the way you set things up.
>
>> ~$ svn mkdir file:///path/to/svn/trunk -m "Adding trunk"
>> ~$ svn mkdir file:///path/to/svn/branches -m "Adding branches"
>> ~$ svn mkdir file:///path/to/svn/tags -m "Adding tags"
>
> Just a note: You can save some commits:
> svn mkdir file:///path/to/svn/{trunk,tags,branches} -m "Initiial
> directory structure"
>
> Creates all three base directories in one commit using bash {}
> expansion.  You can also explicitly type all three URLs, but manually
> repeating them (IMO) is error prone
>
>> ~$ svn mkdir file:///path/to/svn/trunk/tools -m "Adding tools"
>> ~$ svn import /path/to/tools/ file:///path/to/svn/trunk/tools -m
>> "Initial import"
>>
>> Now, I have /path/to/tools in my svn repository. So far so good.
>>
>> Now, I want to pull a read-only always updated working copy in
>> /path/to/tools. So, users can still cd into /path/to/tools and execute
>> the perl scripts just like they used to. But users should not be able
>> to edit any of these files in that working copy.
>
> You must check out a working copy in place of the current directory.  One way
>
> cd /path/to
> # Delete current 'tools' directory (it's all in the repository now)
> rm -rf tools
> # Check out a new, svn managed, 'tools' directory
> svn co file:///path/to/svn/trunk tools
>
> You should also set the owner of the tools directory and files such
> that only they have write permission: everyone else is read-only.
>
>> Also, whenever someone commits something to the repository, I want
>> /path/to/tools to get automatically updated; so users of the scripts
>> always have the latest version.
>
> You must create a svn post-commit hook script.  This script, upon a
> successful commit, would just 'svn update' the /path/to/tools working
> copy (as the correct user).
>
> You can see an example at /path/to/svn/conf/post-commit.tmpl.  See the
> manual for more details.
>
>> I saw that there is a svnsync tool in svn 1.4+, that can help me
>> achieve what I want, but we only have svn 1.3.2 installed on our
>> machines here... and there is no plan of an upgrade anytime soon. Is
>> there another way to do what I want to do?
>
> svnsync to to keep extra (synced) copies of 'repositories'.  It won't
> help you: you need to keep a working copy up-to-date.
>
> - Kevin
>



-- 
this message is composed of 100% recycled ascii

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

Re: Create a read-only always updated working copy

Posted by Kevin Grover <ke...@kevingrover.net>.
On Sat, May 31, 2008 at 9:39 AM, rouble <ro...@gmail.com> wrote:
> SVN gurus,
>
> I have a tools directory that contains many executable perl scripts:
> /path/to/tools
>
> I wanted to add this to svn, so I did this:
> ~$ svnadmin create /path/to/svn

Just a note: I would create an empty directory called 'svn' and then
'svmadmin create' a repository called 'tools' there (svnadmin create
/path/to/svn/tools).  This way, you can add new repositories at any
time.  This is personal preference, the rest of my response will be
based on the way you set things up.

> ~$ svn mkdir file:///path/to/svn/trunk -m "Adding trunk"
> ~$ svn mkdir file:///path/to/svn/branches -m "Adding branches"
> ~$ svn mkdir file:///path/to/svn/tags -m "Adding tags"

Just a note: You can save some commits:
svn mkdir file:///path/to/svn/{trunk,tags,branches} -m "Initiial
directory structure"

Creates all three base directories in one commit using bash {}
expansion.  You can also explicitly type all three URLs, but manually
repeating them (IMO) is error prone

> ~$ svn mkdir file:///path/to/svn/trunk/tools -m "Adding tools"
> ~$ svn import /path/to/tools/ file:///path/to/svn/trunk/tools -m
> "Initial import"
>
> Now, I have /path/to/tools in my svn repository. So far so good.
>
> Now, I want to pull a read-only always updated working copy in
> /path/to/tools. So, users can still cd into /path/to/tools and execute
> the perl scripts just like they used to. But users should not be able
> to edit any of these files in that working copy.

You must check out a working copy in place of the current directory.  One way

cd /path/to
# Delete current 'tools' directory (it's all in the repository now)
rm -rf tools
# Check out a new, svn managed, 'tools' directory
svn co file:///path/to/svn/trunk tools

You should also set the owner of the tools directory and files such
that only they have write permission: everyone else is read-only.

> Also, whenever someone commits something to the repository, I want
> /path/to/tools to get automatically updated; so users of the scripts
> always have the latest version.

You must create a svn post-commit hook script.  This script, upon a
successful commit, would just 'svn update' the /path/to/tools working
copy (as the correct user).

You can see an example at /path/to/svn/conf/post-commit.tmpl.  See the
manual for more details.

> I saw that there is a svnsync tool in svn 1.4+, that can help me
> achieve what I want, but we only have svn 1.3.2 installed on our
> machines here... and there is no plan of an upgrade anytime soon. Is
> there another way to do what I want to do?

svnsync to to keep extra (synced) copies of 'repositories'.  It won't
help you: you need to keep a working copy up-to-date.

- Kevin

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