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

RE: Detecting changes to create a build.

From: Reedick, Andrew <Andrew.Reedick_at_BellSouth.com>
Date: 2006-08-04 22:56:22 CEST

> -----Original Message-----
> From: Anastasios Angelidis [mailto:voodoo@videotron.ca]
>
>
> Say I have a web site which has about a dozen html files.
> Over the time
> all files have been modified in some way. Now for my current
> project I
> modiffy only 3 of these 12 files. When I create my build to deploy, I
> only need those 3 files.
>
> Can I actually write a script that automatically checks out those 3
> files and creates a "package" by using svn commands? Would I
> be able to
> detect these changes or would I have to remember what exact
> files where
> changed and explicitly put those files in the build script? Say those
> files where checked individually creating 3 new revisions.
>

Initially I tried 'svn diff' to get a delta for a previous project, but
'svn diff' underreports changes because it doesn't walk into directories
that would be merged.

You should be able to do a dry-run unmerge to get the list of files.
'svn merge --dry-run -r 100:97' to get the list of files that changed.
I haven't personally verified that though. Actually, I think the merge
uses the diff algorithm, so 'merge --dry-run' is probably vulnerable to
underreporting also.

You could also walk the new revisions 'svn log -v -q -r
OLD_BASELINE+1:NEW_BASELINE url' and analyze the changed file. It
should be trivial to script that to get the delta.

        foreach 'svn log -v -q -r OLD_BASELINE+1:NEW_BASELINE url' {
                foreach 'Action Filename' listed
                        hash{filename} = action
        }
        foreach filename in hash {
                if action is 'A' or 'M'
                        add it to your delta (svn export filename)
                elif action is 'D'
                        add filename to your list_of_files_to_delete
                        # your deployment script would do the deletes
                else
                        die # never should get here...
                fi
        }

I wound up writing a script to 'svn info -R' both baselines and then did
a diff to create my delta. The script is overly specific to my needs,
and the company I work for has more laywers than [insert deity of choice
here], otherwise I would share. That and the solution I mentioned above
is probably simpler and faster...

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. 162

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Aug 4 22:58:20 2006

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