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

Re: Export entire changed files for zip patch

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-06-27 18:41:20 CEST

On Jun 27, 2007, at 10:02, Scott Pederick wrote:

> I'm working on a number of php projects that I want to generate a
> zip that contains the files changed from one version to another.
> This makes it easy to apply, especially when you only have ftp access.
>
> So far I've been able to generate a list of the files that have
> changed:
>
> svn diff -r PREV:HEAD --summarize | sed -e "s/^[AM].*//pi" | sort |
> uniq > files.txt
>
> I then loop through the list to export the files from svn to a
> temporary location so I can zip it up. I can export the files into
> one directory but I'm having trouble re-creating the directory
> structure to start with.

Oh? How so? "basename" and "mkdir -p" should be your friend...

Your sed is surely wrong, though; it looks like you're asking it to
match lines that begin with "A" or "M", delete the entire contents
line, and print the blank line, which is surely not what you want...

I'd say you probably want something more like:

sed -n -E -e "s/^[AM].{6}//p"

-n: don't print by default
-E: use modern regex syntax
-e: use the following regex

(At least, those flags are accurate for my BSD sed. With GNU sed it
may be different.)

Then search for lines starting with "A" or "M", followed by any 6
characters, delete those 7 characters, and print the rest of the line.

> Before I continue to bang my head against this one, does anyone
> know of any pre-existing scripts of the like that solve this
> problem? I know I'm not alone in this but I can't find any
> solutions that help with this bit. At this point I'm assuming that
> I'm looking for the wrong thing or in the wrong direction.

Not aware of any existing script, but people do ask for this
functionality on this list with surprising regularity, so probably
someone has already written a script.

How were you planning on handling deletions, by the way?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 27 18:41:41 2007

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