You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andy Jarrett <an...@gmail.com> on 2005/05/18 09:45:54 UTC

Export only modified files

Hi there,

Im using SVN for my web projects and want to know if there is a way to
only export modified files and their directory structure instead of
exporting the whole site (folder) for upload.

Andy J
www.andyjarrett.co.uk

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


RE: Export only modified files

Posted by Tom McMillen <th...@mppglobal.com>.

-----Original Message-----
From: Stephane Bortzmeyer [mailto:bortzmeyer@nic.fr]
Sent: 18 May 2005 11:41
To: Andy Jarrett
Cc: users@subversion.tigris.org
Subject: Re: Export only modified files

On Wed, May 18, 2005 at 10:45:54AM +0100,
 Andy Jarrett <an...@gmail.com> wrote
 a message of 13 lines which said:

> Im using SVN for my web projects and want to know if there is a way
> to only export modified files and their directory structure instead
> of exporting the whole site (folder) for upload.

I suggest to use a script (written with one of the many bindings of
Subversion) which will display the names. Then your Makefile (or
whatever installation system you use) will use the output of the
script to call cp or install or whatever.
[TM] 
similarly I have a batch script that runs on windows with unix utils installed that does something similar, taking the last commit and finding only the files that want deploying.. it may give you a start

Re: Export only modified files

Posted by Stephane Bortzmeyer <bo...@nic.fr>.
On Wed, May 18, 2005 at 10:45:54AM +0100,
 Andy Jarrett <an...@gmail.com> wrote 
 a message of 13 lines which said:

> Im using SVN for my web projects and want to know if there is a way
> to only export modified files and their directory structure instead
> of exporting the whole site (folder) for upload.

I suggest to use a script (written with one of the many bindings of
Subversion) which will display the names. Then your Makefile (or
whatever installation system you use) will use the output of the
script to call cp or install or whatever.

I attach a Python script which displays the list of files modified in
the last revision (or before, if you use -r).

AFNIC/CODEV-NIC/codev % svnchanged 
/internal/management/svnchanged_last.py

AFNIC/CODEV-NIC/codev % svnchanged -r 204
/src/samples/forbidden-words/add.py
/src/samples/forbidden-words/search.py

Re: Export only modified files

Posted by Stephane Bortzmeyer <bo...@nic.fr>.
On Wed, May 18, 2005 at 01:38:48PM +0200,
 Ulrich Eckhardt <ec...@satorlaser.com> wrote 
 a message of 15 lines which said:

> I'm not exactly sure what your goal is, but I guess that the tool
> you want is called 'rsync'.

Beware: rsync does not know subversion and therefore will copy even
the files that are not under version control... You can use --exclude
for some obvious patterns but not for all unmanaged files.


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

Re: Export only modified files

Posted by Blair Zajac <bl...@orcaware.com>.
Ryan Schmidt wrote:
> You can have a working copy of your site on the live server, and point 
> the Apache DocumentRoot at it. Then you can use "svn up" to update it 
> whenever you like. In this case you probably want to set up an 
> additional Apache rule to block access to the .svn directories. For 
> example, here's a solution with mod_rewrite:
> 
> RewriteEngine On
> RewriteRule (^|/)\.svn(/|$) - [F]

I haven't done any testing on how CPU intensive mod_rewrite is compared 
to using DirectoryMatch, but I use this to protect my live working copies.

# Prevent any access to .svn directories.
<DirectoryMatch "^/.*/\.svn/">
     Options None
     AllowOverride None
     Order allow,deny
     Deny from all
</DirectoryMatch>

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<bl...@orcaware.com>
Subversion and Orca training and consulting
http://www.orcaware.com/svn/

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

Re: Export only modified files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On 18.05.2005, at 15:30, Mike Dewhirst wrote:

>> Actually, I think the tool he wants is 'svn update'.  :-)
>
> OK - I'm thinking out loud here - if the website is actually a working 
> copy and a cron job or human does svn update from time to time then 
> any changes committed will end up in the site. Only the changes are 
> shipped.
>
> ???

Bingo.

You can have a working copy of your site on the live server, and point 
the Apache DocumentRoot at it. Then you can use "svn up" to update it 
whenever you like. In this case you probably want to set up an 
additional Apache rule to block access to the .svn directories. For 
example, here's a solution with mod_rewrite:

RewriteEngine On
RewriteRule (^|/)\.svn(/|$) - [F]

What we do is this: we have a working copy on the live server, but 
Apache doesn't point at this directly. Instead, we export this working 
copy to another directory, and point the DocumentRoot at that. 
Actually, we made it more complicated still: Our working copy is not a 
working copy of trunk, but rather of a specific released tag. And so we 
don't actually "svn up", we "svn switch" to the new tag. The directory 
we export to is always a new directory, with the tag name in its name. 
Then a symlink points the most current export, and the DocumentRoot 
points at the symlink.

Here's what our directory structure looks like:

/vhosts/
	project1/
		svn/ <- working copy
		releases/
			release-1.0/ <- export of the working copy
			release-1.0.1/ <- another export made at a later time
		live <- symlink to releases/release-1.0.1

And the Apache vhost configuration for project1 has DocumentRoot 
pointed at /vhosts/project1/live

We automated the update process with a short bash script. It prompt you 
for the name of the tag you want to switch to, switches to it, does the 
export, and outputs the command you need to execute to update the 
"live" symlink -- for example "rm -f live; ln -s releases/release-1.0.2 
live". So when you're ready, you run that, and the site is updated. If 
for some reason you need to quickly switch back to the previous 
version, it's just a simple "rm -f live; ln -s releases/release-1.0.1 
live" away.


On 18.05.2005, at 15:21, Duncan Murdoch wrote:

> Is there now an option not to keep the backup copies in a checkout? 
> One reason not to use update on a web page is that often they have 
> limited disk space, and storing two of everything is excessive.
>
> There are other reasons too, the most likely of which is that the user 
> won't be allowed to install and/or run svn on the server, but I think 
> the smiley shows you knew that.

Yes, we thankfully administer our own server with plentiful disk space 
so we can do what we like with it. But you could certainly have a 
working copy on your development machine, then do an export to another 
directory, then rsync that directory to the live server.


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

Re: Export only modified files

Posted by Mike Dewhirst <mi...@dewhirst.com.au>.
Ben Collins-Sussman wrote:
> 
> On May 18, 2005, at 6:38 AM, Ulrich Eckhardt wrote:
> 
>> Andy Jarrett wrote:
>>
>>> Im using SVN for my web projects and want to know if there is a  way to
>>> only export modified files and their directory structure instead of
>>> exporting the whole site (folder) for upload.
>>>
>>
>> I'm not exactly sure what your goal is, but I guess that the tool  you 
>> want is
>> called 'rsync'.
>>
> 
> Actually, I think the tool he wants is 'svn update'.  :-)

OK - I'm thinking out loud here - if the website is actually a working 
copy and a cron job or human does svn update from time to time then any 
changes committed will end up in the site. Only the changes are shipped.

???

Mike



> ---------------------------------------------------------------------
> 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

Re: Export only modified files

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-05-18 14:21:52 +0100, Duncan Murdoch wrote:
> Is there now an option not to keep the backup copies in a checkout? One 
> reason not to use update on a web page is that often they have limited 
> disk space, and storing two of everything is excessive.
> 
> There are other reasons too, the most likely of which is that the user 
> won't be allowed to install and/or run svn on the server, but I think 
> the smiley shows you knew that.

Same problem when one wants to upload files to a PDA... in my case,
a Zaurus. I'm using the following commands:

svn list -R | grep -v '/$' | rsync --files-from=- -zuv --progress -e ssh \
  --rsync-path=/home/QtPalmtop/bin/rsync . ${host}:sd/wd/

Note: the "grep -v '/$'" is necessary due to an rsync bug.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Export only modified files

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
Ben Collins-Sussman wrote:
> On May 18, 2005, at 6:38 AM, Ulrich Eckhardt wrote:
> 
> 
>>Andy Jarrett wrote:
>>
>>
>>>Im using SVN for my web projects and want to know if there is a  
>>>way to
>>>only export modified files and their directory structure instead of
>>>exporting the whole site (folder) for upload.
>>>
>>
>>I'm not exactly sure what your goal is, but I guess that the tool  
>>you want is
>>called 'rsync'.
>>
> 
> 
> Actually, I think the tool he wants is 'svn update'.  :-)

Is there now an option not to keep the backup copies in a checkout? One 
reason not to use update on a web page is that often they have limited 
disk space, and storing two of everything is excessive.

There are other reasons too, the most likely of which is that the user 
won't be allowed to install and/or run svn on the server, but I think 
the smiley shows you knew that.

Duncan Murdoch


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

Re: Export only modified files

Posted by Ben Collins-Sussman <su...@collab.net>.
On May 18, 2005, at 6:38 AM, Ulrich Eckhardt wrote:

> Andy Jarrett wrote:
>
>> Im using SVN for my web projects and want to know if there is a  
>> way to
>> only export modified files and their directory structure instead of
>> exporting the whole site (folder) for upload.
>>
>
> I'm not exactly sure what your goal is, but I guess that the tool  
> you want is
> called 'rsync'.
>

Actually, I think the tool he wants is 'svn update'.  :-)


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

Re: Export only modified files

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
Andy Jarrett wrote:
> Im using SVN for my web projects and want to know if there is a way to
> only export modified files and their directory structure instead of
> exporting the whole site (folder) for upload.

I'm not exactly sure what your goal is, but I guess that the tool you want is 
called 'rsync'.

;)

Uli

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